Skip to content

Commit

Permalink
test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chalapkoStanislav committed Jul 8, 2024
1 parent b6770d2 commit bf78d3d
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 3 deletions.
12 changes: 12 additions & 0 deletions pages/dashboard/dashboard-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ exports.DashboardPage = class DashboardPage extends BasePage {
this.selectedRadioButtonLabel = page.locator('label[class*="components_forms__radio-label checked"]').first();
this.selectedRadioImageLabel = page.locator('label[class*="checked"] span[class*="text"]').first();
this.onboardingPaginator = page.locator('div[class*="onboarding_questions__paginator"]');
this.onboardingLetsGoBtn = page.locator('button[class*="main_ui_releases"][class*="next-btn"]');

this.onboardingFirstHeader = page.locator('*[class*="onboarding_questions__modal-title"]');
this.whatNewsHeader = page.locator('*[class*="modal-title"]');
}

async createFileViaPlaceholder() {
Expand Down Expand Up @@ -627,6 +629,15 @@ exports.DashboardPage = class DashboardPage extends BasePage {
await this.onboardingContinueBtn.click();
}

async clickOnLetsGoBtn() {
await this.onboardingLetsGoBtn.click();
}
async skipWhatNewsPopUp() {
if (await this.whatNewsHeader.isVisible()) {
await this.clickOnLetsGoBtn();
}
}

async checkOnboardingWelcomeHeader(text) {
await expect(this.onboardingHeader.first()).toHaveText(text);
}
Expand Down Expand Up @@ -716,6 +727,7 @@ exports.DashboardPage = class DashboardPage extends BasePage {
await this.clickOnStartButton();
await this.clickOnOnboardingContinueBtn();
await this.clickOnOnboardingContinueWithoutTeamButton();
await this.skipWhatNewsPopUp();
}

async fillOnboardingFirstQuestions() {
Expand Down
5 changes: 5 additions & 0 deletions pages/dashboard/team-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ exports.TeamPage = class TeamPage extends BasePage {
);
this.teamSettingsSection = page.locator('.main_ui_dashboard__dashboard-content');
this.teamIcon = page.locator(`div[class*='team-icon'] img`);
this.inviteMessage = page.locator('div[class*="main-message"]');
}

async createTeam(teamName) {
Expand Down Expand Up @@ -411,4 +412,8 @@ exports.TeamPage = class TeamPage extends BasePage {
await this.page.locator(`li span[class*="components_select"]:has-text("${name}")`).click();
await this.ownerLeaveTeamButton.click();
}

async isInviteMessageDisplayed(message) {
await expect(this.inviteMessage).toHaveText(message);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ test.describe(() => {
await mainPage.showMainComponentViaRightClick();
const newPage = await popupPromise;
await mainPage.isCreatedLayerVisible();
await newPage.waitForTimeout(200);
await expect(newPage).toHaveScreenshot('board-component-on-first-file.png', {
mask: [mainPage.usersSection],
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,12 @@ test.describe(() => {

mainTest(
qase(1445,'PENPOT-1445 Create a component and 2 copies of it, change shadow opacity and color of main'),
async () => {
async ({ page }) => {
await layersPanelPage.clickMainComponentOnLayersTab();
await mainPage.waitForChangeIsSaved();
await designPanelPage.clickAddShadowButton();
await page.waitForTimeout(200);
await mainPage.waitForChangeIsSaved();
await layersPanelPage.clickMainComponentOnLayersTab();
await mainPage.refreshPage();
await expect(mainPage.viewport).toHaveScreenshot(
'main-copies-component-shadow-default.png',
Expand All @@ -184,7 +185,9 @@ test.describe(() => {
await colorPalettePage.setHex('#09e5ec');
await mainPage.waitForChangeIsSaved();
await layersPanelPage.clickMainComponentOnLayersTab();
await mainPage.waitForChangeIsSaved();
await mainPage.refreshPage();
await page.waitForTimeout(200);
await expect(mainPage.viewport).toHaveScreenshot('main-copies-component-shadow-updated.png', {
mask: [mainPage.guides, mainPage.guidesFragment],
maxDiffPixels: 0,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion tests/dashboard/dashboard-teams.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1760,8 +1760,9 @@ test.describe(() => {
await loginPage.isLoginPageOpened();

await page.goto(firstInvite.inviteUrl);
await teamPage.isSuccessMessageDisplayed('Something wrong has happened.');
await teamPage.isInviteMessageDisplayed('Invite invalid');

await loginPage.goto();
await loginPage.enterEmail(process.env.LOGIN_EMAIL);
await loginPage.enterPwd(process.env.LOGIN_PWD);
await loginPage.clickLoginButton();
Expand Down

0 comments on commit bf78d3d

Please sign in to comment.