add 52,54,1184,1187,1197,1198

This commit is contained in:
chalapkoStanislav 2024-06-05 18:06:22 +03:00
parent 0703e4bf4a
commit 9e43424854
4 changed files with 340 additions and 6 deletions

View File

@ -61,6 +61,7 @@ exports.TeamPage = class TeamPage extends BasePage {
this.editorRoleSelector = page.locator('li:has-text("Editor")');
this.ownerRoleSelector = page.locator('li:has-text("Owner")');
this.transferOwnershipButton = page.locator('input[value="Transfer ownership"]');
this.leaveTeamButton = page.locator('input[value="Leave team"]');
this.inviteMembersToTeamEmailInput = page.locator(
'input[placeholder="Emails, comma separated"]',
);
@ -87,6 +88,9 @@ exports.TeamPage = class TeamPage extends BasePage {
this.invitationRecordDeleteInvititationMenuItem = page.locator(
'li:has-text("Delete invitation")',
);
this.memberRecordleaveTeamMenuItem = page.locator(
'li:has-text("Leave team")',
);
this.invitationWarningSpan = page.locator(
'aside[class*="warning"] div[class*="context_notification"]',
);
@ -255,6 +259,10 @@ exports.TeamPage = class TeamPage extends BasePage {
await this.transferOwnershipButton.click();
}
async clickOnLeaveTeamButton() {
await this.leaveTeamButton.click();
}
async resendInvitation() {
await this.invitationRecordOptionsMenuButton.click();
await this.invitationRecordResendInvititationMenuItem.click();
@ -265,6 +273,14 @@ exports.TeamPage = class TeamPage extends BasePage {
await this.invitationRecordDeleteInvititationMenuItem.click();
}
async leaveTeam(teamName) {
await this.invitationRecordOptionsMenuButton.click();
await this.memberRecordleaveTeamMenuItem.click();
await this.clickOnLeaveTeamButton();
await expect(this.teamCurrentBtn).not.toHaveText(teamName);
await expect(this.teamCurrentBtn).toHaveText('Your Penpot');
}
async isInvitationRecordRemoved() {
await expect(this.invitationRecord).not.toBeVisible();
}

View File

@ -823,6 +823,272 @@ test.describe(() => {
},
);
mainTest(
qase(1184,'DA-98 Team. Members - change role via owner (editor to admin)'),
async ({ page }, testInfo) => {
await testInfo.setTimeout(testInfo.timeout + 60000);
const profilePage = new ProfilePage(page);
const dashboardPage = new DashboardPage(page);
const loginPage = new LoginPage(page);
const teamPage = new TeamPage(page);
const registerPage = new RegisterPage(page);
const secondUser = random().concat('autotest');
const secondEmail = `${process.env.GMAIL_NAME}+${secondUser}@gmail.com`;
await teamPage.createTeam(team);
await teamPage.isTeamSelected(team);
await teamPage.openInvitationsPageViaOptionsMenu();
await teamPage.clickInviteMembersToTeamButton();
await teamPage.isInviteMembersPopUpHeaderDisplayed(
'Invite members to the team',
);
await teamPage.enterEmailToInviteMembersPopUp(secondEmail);
await teamPage.clickSendInvitationButton();
await teamPage.isSuccessMessageDisplayed('Invitation sent successfully');
await page.waitForTimeout(30000);
const secondInvite = await getRegisterMessage(secondEmail)
await profilePage.logout();
await loginPage.isLoginPageOpened();
await page.goto(secondInvite.inviteUrl);
await registerPage.isRegisterPageOpened();
await registerPage.enterEmail(secondEmail);
await registerPage.enterPassword(process.env.LOGIN_PWD);
await registerPage.clickOnCreateAccountBtn();
await registerPage.enterFullName(secondUser);
await registerPage.clickOnAcceptTermsCheckbox();
await registerPage.clickOnCreateAccountSecondBtn();
await dashboardPage.isOnboardingNextBtnDisplayed();
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.checkOnboardingWelcomeHeader('Before you start');
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.reloadPage();
await teamPage.isTeamSelected(team);
await profilePage.logout();
await loginPage.isLoginPageOpened();
await loginPage.enterEmail(process.env.LOGIN_EMAIL);
await loginPage.enterPwd(process.env.LOGIN_PWD);
await loginPage.clickLoginButton();
await dashboardPage.isDashboardOpenedAfterLogin();
await teamPage.switchTeam(team);
await teamPage.isTeamSelected(team);
await teamPage.openMembersPageViaOptionsMenu();
await teamPage.selectMemberRoleInPopUp(secondUser, 'Admin');
await teamPage.isMultipleMemberRecordDisplayed(
secondUser,
secondEmail,
'Admin'
);
await profilePage.logout();
await loginPage.isLoginPageOpened();
await loginPage.enterEmail(secondEmail);
await loginPage.enterPwd(process.env.LOGIN_PWD);
await loginPage.clickLoginButton();
await dashboardPage.isDashboardOpenedAfterLogin();
await teamPage.switchTeam(team);
await teamPage.isTeamSelected(team);
await teamPage.openMembersPageViaOptionsMenu();
await teamPage.isMultipleMemberRecordDisplayed(
secondUser,
secondEmail,
'Admin'
);
},
);
mainTest(
qase(1187,'DA-101 Team. Members - change role via admin(admin to editor)'),
async ({ page }) => {
const firstAdmin = random().concat('autotest');
const secondAdmin = random().concat('autotest');
const firstEmail = `${process.env.GMAIL_NAME}+${firstAdmin}@gmail.com`;
const secondEmail = `${process.env.GMAIL_NAME}+${secondAdmin}@gmail.com`;
const profilePage = new ProfilePage(page);
const dashboardPage = new DashboardPage(page);
const loginPage = new LoginPage(page);
const teamPage = new TeamPage(page);
const registerPage = new RegisterPage(page);
await teamPage.createTeam(team);
await teamPage.isTeamSelected(team);
await teamPage.openInvitationsPageViaOptionsMenu();
await teamPage.clickInviteMembersToTeamButton();
await teamPage.isInviteMembersPopUpHeaderDisplayed(
'Invite members to the team',
);
await teamPage.enterEmailToInviteMembersPopUp(`${firstEmail}, ${secondEmail}`);
await teamPage.selectInvitationRoleInPopUp('Admin');
await teamPage.clickSendInvitationButton();
await teamPage.isSuccessMessageDisplayed('Invitation sent successfully');
await page.waitForTimeout(30000);
const firstInvite = await getRegisterMessage(firstEmail);
const secondInvite = await getRegisterMessage(secondEmail);
await profilePage.logout();
await loginPage.isLoginPageOpened();
await page.goto(firstInvite.inviteUrl);
await registerPage.isRegisterPageOpened();
await registerPage.enterEmail(firstEmail);
await registerPage.enterPassword(process.env.LOGIN_PWD);
await registerPage.clickOnCreateAccountBtn();
await registerPage.enterFullName(firstAdmin);
await registerPage.clickOnAcceptTermsCheckbox();
await registerPage.clickOnCreateAccountSecondBtn();
await dashboardPage.isOnboardingNextBtnDisplayed();
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.checkOnboardingWelcomeHeader('Before you start');
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.reloadPage();
await teamPage.isTeamSelected(team);
await profilePage.logout();
await loginPage.isLoginPageOpened();
await page.goto(secondInvite.inviteUrl);
await registerPage.isRegisterPageOpened();
await registerPage.enterEmail(secondEmail);
await registerPage.enterPassword(process.env.LOGIN_PWD);
await registerPage.clickOnCreateAccountBtn();
await registerPage.enterFullName(secondAdmin);
await registerPage.clickOnAcceptTermsCheckbox();
await registerPage.clickOnCreateAccountSecondBtn();
await dashboardPage.isOnboardingNextBtnDisplayed();
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.checkOnboardingWelcomeHeader('Before you start');
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.reloadPage();
await teamPage.isTeamSelected(team);
await teamPage.openMembersPageViaOptionsMenu();
await teamPage.isMultipleMemberRecordDisplayed(
firstAdmin,
firstEmail,
'Admin'
);
await teamPage.isMultipleMemberRecordDisplayed(
secondAdmin,
secondEmail,
'Admin'
);
await teamPage.selectMemberRoleInPopUp(firstAdmin, 'Editor');
await teamPage.isMultipleMemberRecordDisplayed(
firstAdmin,
firstEmail,
'Editor'
);
await profilePage.logout();
await loginPage.isLoginPageOpened();
await loginPage.enterEmail(firstEmail);
await loginPage.enterPwd(process.env.LOGIN_PWD);
await loginPage.clickLoginButton();
await dashboardPage.isDashboardOpenedAfterLogin();
await teamPage.switchTeam(team);
await teamPage.isTeamSelected(team);
await teamPage.openMembersPageViaOptionsMenu();
await teamPage.isMultipleMemberRecordDisplayed(
firstAdmin,
firstEmail,
'Editor'
);
},
);
mainTest(
qase(1197,'DA-111 Team. Members - leave team (as admin)'),
async ({ page }) => {
const firstAdmin = random().concat('autotest');
const firstEmail = `${process.env.GMAIL_NAME}+${firstAdmin}@gmail.com`;
const profilePage = new ProfilePage(page);
const dashboardPage = new DashboardPage(page);
const loginPage = new LoginPage(page);
const teamPage = new TeamPage(page);
const registerPage = new RegisterPage(page);
await teamPage.createTeam(team);
await teamPage.isTeamSelected(team);
await teamPage.openInvitationsPageViaOptionsMenu();
await teamPage.clickInviteMembersToTeamButton();
await teamPage.isInviteMembersPopUpHeaderDisplayed(
'Invite members to the team',
);
await teamPage.enterEmailToInviteMembersPopUp(firstEmail);
await teamPage.selectInvitationRoleInPopUp('Admin');
await teamPage.clickSendInvitationButton();
await teamPage.isSuccessMessageDisplayed('Invitation sent successfully');
await page.waitForTimeout(30000);
const firstInvite = await getRegisterMessage(firstEmail);
await profilePage.logout();
await loginPage.isLoginPageOpened();
await page.goto(firstInvite.inviteUrl);
await registerPage.isRegisterPageOpened();
await registerPage.enterEmail(firstEmail);
await registerPage.enterPassword(process.env.LOGIN_PWD);
await registerPage.clickOnCreateAccountBtn();
await registerPage.enterFullName(firstAdmin);
await registerPage.clickOnAcceptTermsCheckbox();
await registerPage.clickOnCreateAccountSecondBtn();
await dashboardPage.isOnboardingNextBtnDisplayed();
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.checkOnboardingWelcomeHeader('Before you start');
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.reloadPage();
await teamPage.isTeamSelected(team);
await teamPage.openMembersPageViaOptionsMenu();
await teamPage.leaveTeam(team);
},
);
mainTest(
qase(1198,'DA-112 Team. Members - leave team (as editor)'),
async ({ page }) => {
const firstAdmin = random().concat('autotest');
const firstEmail = `${process.env.GMAIL_NAME}+${firstAdmin}@gmail.com`;
const profilePage = new ProfilePage(page);
const dashboardPage = new DashboardPage(page);
const loginPage = new LoginPage(page);
const teamPage = new TeamPage(page);
const registerPage = new RegisterPage(page);
await teamPage.createTeam(team);
await teamPage.isTeamSelected(team);
await teamPage.openInvitationsPageViaOptionsMenu();
await teamPage.clickInviteMembersToTeamButton();
await teamPage.isInviteMembersPopUpHeaderDisplayed(
'Invite members to the team',
);
await teamPage.enterEmailToInviteMembersPopUp(firstEmail);
await teamPage.clickSendInvitationButton();
await teamPage.isSuccessMessageDisplayed('Invitation sent successfully');
await page.waitForTimeout(30000);
const firstInvite = await getRegisterMessage(firstEmail);
await profilePage.logout();
await loginPage.isLoginPageOpened();
await page.goto(firstInvite.inviteUrl);
await registerPage.isRegisterPageOpened();
await registerPage.enterEmail(firstEmail);
await registerPage.enterPassword(process.env.LOGIN_PWD);
await registerPage.clickOnCreateAccountBtn();
await registerPage.enterFullName(firstAdmin);
await registerPage.clickOnAcceptTermsCheckbox();
await registerPage.clickOnCreateAccountSecondBtn();
await dashboardPage.isOnboardingNextBtnDisplayed();
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.checkOnboardingWelcomeHeader('Before you start');
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.reloadPage();
await teamPage.isTeamSelected(team);
await teamPage.openMembersPageViaOptionsMenu();
await teamPage.leaveTeam(team);
},
);
test.afterEach(async ({ page }) => {
const teamPage = new TeamPage(page);
const dashboardPage = new DashboardPage(page);

View File

@ -18,6 +18,17 @@ test(qase(50,'ON-23 Forgot password flow with invalid email'), async ({ page })
await forgotPasswordPage.isRecoverPasswordButtonDisabled();
});
// test(qase(51,'ON-24 Forgot password flow with inexisted email'), async ({ page }) => {
// const loginPage = new LoginPage(page);
// const forgotPasswordPage = new ForgotPasswordPage(page);
// await loginPage.goto();
// await loginPage.clickOnForgotPassword();
// const email = `${process.env.GMAIL_NAME}autotest+${random()}@gmail.com`;
// await forgotPasswordPage.enterEmail(email);
// await forgotPasswordPage.clickRecoverPasswordButton();
// await forgotPasswordPage.isRecoverPasswordButtonDisabled();
// });
test.describe(() => {
let randomName,email,invite;
test.beforeEach(async ({ page }, testInfo) => {
@ -26,6 +37,7 @@ test.describe(() => {
email = `${process.env.GMAIL_NAME}+${randomName}@gmail.com`;
const loginPage = new LoginPage(page);
const registerPage = new RegisterPage(page);
const dashboardPage = new DashboardPage(page);
await loginPage.goto();
await loginPage.acceptCookie();
await loginPage.clickOnCreateAccount();
@ -40,6 +52,12 @@ test.describe(() => {
await registerPage.isRegisterEmailCorrect(email);
await page.waitForTimeout(30000);
invite = await getRegisterMessage(email);
await page.goto(invite.inviteUrl);
await dashboardPage.isOnboardingNextBtnDisplayed();
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.checkOnboardingWelcomeHeader('Before you start');
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.reloadPage();
});
test(qase(49,'ON-22 Forgot password flow'), async ({ page }) => {
@ -48,12 +66,6 @@ test.describe(() => {
const loginPage = new LoginPage(page);
const profilePage = new ProfilePage(page);
const forgotPasswordPage = new ForgotPasswordPage(page);
await page.goto(invite.inviteUrl);
await dashboardPage.isOnboardingNextBtnDisplayed();
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.checkOnboardingWelcomeHeader('Before you start');
await dashboardPage.clickOnOnboardingNextBtn();
await dashboardPage.reloadPage();
await profilePage.logout();
await loginPage.isLoginPageOpened();
await loginPage.clickOnForgotPassword();
@ -72,6 +84,32 @@ test.describe(() => {
await loginPage.clickLoginButton();
await dashboardPage.isDashboardOpenedAfterLogin();
});
test(qase(52,'ON-25 Login with old password'), async ({ page }) => {
const newPwd = 'TestForgotPassword123';
const dashboardPage = new DashboardPage(page);
const loginPage = new LoginPage(page);
const profilePage = new ProfilePage(page);
const forgotPasswordPage = new ForgotPasswordPage(page);
await profilePage.logout();
await loginPage.isLoginPageOpened();
await loginPage.clickOnForgotPassword();
await forgotPasswordPage.enterEmail(email);
await forgotPasswordPage.clickRecoverPasswordButton();
await page.waitForTimeout(30000);
const forgotPass = await getRegisterMessage(email);
await checkRecoveryText(forgotPass.inviteText, randomName);
await page.goto(forgotPass.inviteUrl);
await forgotPasswordPage.enterNewPwd(newPwd);
await forgotPasswordPage.enterConfirmPwd(newPwd);
await forgotPasswordPage.clickOnChangePwdButton();
await loginPage.isLoginPageOpened();
await loginPage.enterEmail(email);
await loginPage.enterPwd(process.env.LOGIN_PWD);
await loginPage.clickLoginButton();
await loginPage.isLoginErrorMessageDisplayed('Email or password is incorrect.');
});
});
test.afterEach(async ({ page }, testInfo) => {

View File

@ -133,6 +133,20 @@ test(qase(36,'ON-9 Create demo account'), async ({ page }) => {
await dashboardPage.isHeaderDisplayed('Projects');
});
test(qase(54,'ON-27 Sign up with email of existing user'), async ({ page }) => {
const loginPage = new LoginPage(page);
const registerPage = new RegisterPage(page);
await loginPage.goto();
await loginPage.clickOnCreateAccount();
await registerPage.isRegisterPageOpened();
await registerPage.enterEmail(process.env.LOGIN_EMAIL);
await registerPage.enterPassword(process.env.LOGIN_PWD);
await registerPage.clickOnCreateAccountBtn();
await registerPage.isEmailInputErrorDisplayed('Email already used');
await registerPage.isCreateAccountBtnDisplayed();
await registerPage.isCreateAccountBtnDisabled();
});
test.afterEach(async ({ page }, testInfo) => {
await updateTestResults(testInfo.status, testInfo.retry)
});