Fixed failing test case_113_new_organization_pipeline (#111)

added workaround for detached elements
main
Kirill Lakhov 4 years ago committed by GitHub
parent 05e6143a21
commit 489c115bb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,28 +6,35 @@
context('New organization pipeline.', () => { context('New organization pipeline.', () => {
const caseId = '113'; const caseId = '113';
const firstUserName = 'Firstuser'; const firstUserName = 'Firstuser';
const secondUserName = 'Seconduser'; const secondUserName = 'Seconduser';
const thirdUserName = 'Thirduser'; const thirdUserName = 'Thirduser';
const users = {
const firstUser = { thirdUser: {
firstName: `${firstUserName} fitstname`, name: thirdUserName,
lastName: `${firstUserName} lastname`, firstName: `${thirdUserName} fitstname`,
emailAddr: `${firstUserName.toLowerCase()}@local.local`, lastName: `${thirdUserName} lastname`,
password: 'UfdU21!dds', emailAddr: `${thirdUserName.toLowerCase()}@local.local`,
}; password: 'Fv5Df3#f55g',
const secondUser = { },
firstName: `${secondUserName} fitstname`, secondUser: {
lastName: `${secondUserName} lastname`, name: secondUserName,
emailAddr: `${secondUserName.toLowerCase()}@local.local`, firstName: `${secondUserName} fitstname`,
password: 'UfdU21!dds', lastName: `${secondUserName} lastname`,
}; emailAddr: `${secondUserName.toLowerCase()}@local.local`,
const thirdUser = { password: 'UfdU21!dds',
firstName: `${thirdUserName} fitstname`, },
lastName: `${thirdUserName} lastname`, firstUser: {
emailAddr: `${thirdUserName.toLowerCase()}@local.local`, name: firstUserName,
password: 'Fv5Df3#f55g', firstName: `${firstUserName} fitstname`,
lastName: `${firstUserName} lastname`,
emailAddr: `${firstUserName.toLowerCase()}@local.local`,
password: 'UfdU21!dds',
},
}; };
const { firstUser, secondUser, thirdUser } = users;
const organizationParams = { const organizationParams = {
shortName: 'TestOrganization', shortName: 'TestOrganization',
fullName: 'Organization full name. Only for test.', fullName: 'Organization full name. Only for test.',
@ -94,34 +101,21 @@ context('New organization pipeline.', () => {
cy.createZipArchive(directoryToArchive, archivePath); cy.createZipArchive(directoryToArchive, archivePath);
cy.logout(); cy.logout();
cy.goToRegisterPage(); for (const user of Object.values(users)) {
cy.userRegistration( // When we continuously register users, elements on login/register page become detached from DOM
secondUser.firstName, // because of our re-renders after additional requests, waiting is workaround for this issue
secondUser.lastName, // https://github.com/cypress-io/cypress/issues/7306
secondUserName, cy.wait(1000);
secondUser.emailAddr, cy.goToRegisterPage();
secondUser.password, cy.userRegistration(
); user.firstName,
cy.logout(secondUserName); user.lastName,
user.name,
cy.goToRegisterPage(); user.emailAddr,
cy.userRegistration( user.password,
thirdUser.firstName, );
thirdUser.lastName, if (user.name !== firstUserName) cy.logout(user.name);
thirdUserName, }
thirdUser.emailAddr,
thirdUser.password,
);
cy.logout(thirdUserName);
cy.goToRegisterPage();
cy.userRegistration(
firstUser.firstName,
firstUser.lastName,
firstUserName,
firstUser.emailAddr,
firstUser.password,
);
}); });
beforeEach(() => { beforeEach(() => {

Loading…
Cancel
Save