summaryrefslogtreecommitdiff
path: root/cypress/integration/basic.js
blob: 69d59bc2c64a049de8c5199a0b9f5133119949f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
describe('Basic', () => {
	before(() => {
		cy.request('POST', '/api/reset-db');
	});

	beforeEach(() => {
		cy.reload(true);
	});

  it('successfully loads', () => {
    cy.visit('/');
  });

	it('setup instance', () => {
    cy.visit('/');

		cy.get('[data-cy-admin-username] input').type('admin');

		cy.get('[data-cy-admin-password] input').type('admin1234');

		cy.get('[data-cy-admin-ok]').click();
  });

	it('signup', () => {
    cy.visit('/');

		cy.get('[data-cy-signup]').click();

		cy.get('[data-cy-signup-username] input').type('alice');

		cy.get('[data-cy-signup-password] input').type('alice1234');
	
		cy.get('[data-cy-signup-password-retype] input').type('alice1234');

		cy.get('[data-cy-signup-submit]').click();
  });

	it('signin', () => {
    cy.visit('/');

		cy.get('[data-cy-signin]').click();

		cy.get('[data-cy-signin-username] input').type('alice');

		// Enterキーでサインインできるかの確認も兼ねる
		cy.get('[data-cy-signin-password] input').type('alice1234{enter}');
  });

	it('note', () => {
    cy.visit('/');

		//#region TODO: この辺はUI操作ではなくAPI操作でログインする
		cy.get('[data-cy-signin]').click();

		cy.get('[data-cy-signin-username] input').type('alice');

		// Enterキーでサインインできるかの確認も兼ねる
		cy.get('[data-cy-signin-password] input').type('alice1234{enter}');
		//#endregion

		cy.get('[data-cy-open-post-form]').click();

		cy.get('[data-cy-post-form-text]').type('Hello, Misskey!');

		cy.get('[data-cy-open-post-form-submit]').click();

		// TODO: 投稿した文字列が画面内にあるか(=タイムラインに流れてきたか)のテスト
  });
});