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`,
emailAddr: `${firstUserName.toLowerCase()}@local.local`,
password: 'UfdU21!dds',
};
const secondUser = {
firstName: `${secondUserName} fitstname`,
lastName: `${secondUserName} lastname`,
emailAddr: `${secondUserName.toLowerCase()}@local.local`,
password: 'UfdU21!dds',
};
const thirdUser = {
firstName: `${thirdUserName} fitstname`, firstName: `${thirdUserName} fitstname`,
lastName: `${thirdUserName} lastname`, lastName: `${thirdUserName} lastname`,
emailAddr: `${thirdUserName.toLowerCase()}@local.local`, emailAddr: `${thirdUserName.toLowerCase()}@local.local`,
password: 'Fv5Df3#f55g', password: 'Fv5Df3#f55g',
},
secondUser: {
name: secondUserName,
firstName: `${secondUserName} fitstname`,
lastName: `${secondUserName} lastname`,
emailAddr: `${secondUserName.toLowerCase()}@local.local`,
password: 'UfdU21!dds',
},
firstUser: {
name: firstUserName,
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();
for (const user of Object.values(users)) {
// When we continuously register users, elements on login/register page become detached from DOM
// because of our re-renders after additional requests, waiting is workaround for this issue
// https://github.com/cypress-io/cypress/issues/7306
cy.wait(1000);
cy.goToRegisterPage(); cy.goToRegisterPage();
cy.userRegistration( cy.userRegistration(
secondUser.firstName, user.firstName,
secondUser.lastName, user.lastName,
secondUserName, user.name,
secondUser.emailAddr, user.emailAddr,
secondUser.password, user.password,
);
cy.logout(secondUserName);
cy.goToRegisterPage();
cy.userRegistration(
thirdUser.firstName,
thirdUser.lastName,
thirdUserName,
thirdUser.emailAddr,
thirdUser.password,
);
cy.logout(thirdUserName);
cy.goToRegisterPage();
cy.userRegistration(
firstUser.firstName,
firstUser.lastName,
firstUserName,
firstUser.emailAddr,
firstUser.password,
); );
if (user.name !== firstUserName) cy.logout(user.name);
}
}); });
beforeEach(() => { beforeEach(() => {

Loading…
Cancel
Save