Improve tests structure

This commit is contained in:
SleepWalker 2019-12-28 12:25:44 +02:00
parent 5d411fd6ca
commit ba49382fb6
6 changed files with 906 additions and 887 deletions

View File

@ -1,5 +1,6 @@
import { account1 } from '../../fixtures/accounts.json';
describe('Forgot / reset password', () => {
it('should request password reset', () => {
const captchaCode = 'captchaCode';
const emailMask = 'fo*@gm*l.**m';
@ -28,7 +29,10 @@ it('should request password reset', () => {
cy.location('pathname').should('eq', '/forgot-password');
cy.getByTestId('forgot-password-login').should('contain', account1.username);
cy.getByTestId('forgot-password-login').should(
'contain',
account1.username,
);
cy.window().should('have.property', 'e2eCaptchaSetCode');
cy.window().then(win => {
@ -214,3 +218,4 @@ it('should recover password', () => {
}).toString(),
);
});
});

View File

@ -1,6 +1,6 @@
// account1 - authenticated
// account2 - invalid refreshToken
import { account1, account2 } from '../fixtures/accounts.json';
import { account1, account2 } from '../../fixtures/accounts.json';
const multiAccount = createState();
const multiAccountWithBadTokens = createState();

View File

@ -8,6 +8,7 @@ const defaults = {
scope: 'account_info,account_email',
};
describe('OAuth', () => {
it('should complete oauth', () => {
cy.login({ accounts: ['default'] });
@ -274,7 +275,10 @@ describe('prompts', () => {
.contains('Approve')
.click();
cy.url().should('match', /^http:\/\/localhost:8080\/?\?code=[^&]+&state=$/);
cy.url().should(
'match',
/^http:\/\/localhost:8080\/?\?code=[^&]+&state=$/,
);
});
// TODO: enable, when backend api will return correct response on auth decline
@ -355,7 +359,10 @@ describe('prompts', () => {
.contains('Approve')
.click();
cy.url().should('match', /^http:\/\/localhost:8080\/?\?code=[^&]+&state=$/);
cy.url().should(
'match',
/^http:\/\/localhost:8080\/?\?code=[^&]+&state=$/,
);
});
});
@ -418,3 +425,4 @@ function assertPermissions() {
'Access to your Email address',
);
}
});

View File

@ -1,3 +1,4 @@
describe('Register', () => {
it('should register', () => {
const username = `test${Date.now()}`;
const email = `${Date.now()}@gmail.com`;
@ -143,3 +144,4 @@ it('should allow resend code', () => {
cy.location('pathname').should('eq', '/activation');
});
});

View File

@ -1,5 +1,6 @@
import { account1, account2 } from '../../fixtures/accounts.json';
describe('Sign in / Log out', () => {
it('should sign in', () => {
cy.visit('/');
@ -250,3 +251,4 @@ describe('multi account', () => {
cy.get('[data-e2e-account-id]').should('have.length', 0);
});
});
});

View File

@ -1,5 +1,6 @@
import { account1 } from '../../fixtures/accounts.json';
describe('feedback popup', () => {
it('should send feedback', () => {
const subject = 'Hello world';
const message = 'This is a feedback message';
@ -49,3 +50,4 @@ it('should send feedback', () => {
cy.getByTestId('feedbackPopup').should('not.be.visible');
});
});