Skip to content

Commit

Permalink
Merge pull request #125 from penpot/cstanislav/bugfix/daily-reports-f…
Browse files Browse the repository at this point in the history
…ixes-261124

fix(locators): update locators
  • Loading branch information
chalapkoStanislav authored Nov 27, 2024
2 parents 33f968d + 868c853 commit 4f4b89c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
14 changes: 10 additions & 4 deletions pages/workspace/assets-panel-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,16 @@ exports.AssetsPanelPage = class AssetsPanelPage extends BasePage {
);
this.assetsTypeButton = page.getByRole('button', { name: 'Filter' });
this.assetsTypeDropdown = page.locator('ul[class*="context-menu-items"]');
this.assetsTypeAll = page.locator('#section-all');
this.assetsTypeComponents = page.locator('#section-components');
this.assetsTypeColors = page.locator('#section-colors');
this.assetsTypeTypographies = page.locator('#section-typographies');
this.assetsTypeAll = page
.getByRole('menuitem')
.filter({ hasText: 'All assets' });
this.assetsTypeComponents = page
.getByRole('menuitem')
.filter({ hasText: 'Components' });
this.assetsTypeColors = page.getByRole('menuitem').filter({ hasText: 'Colors' });
this.assetsTypeTypographies = page
.getByRole('menuitem')
.filter({ hasText: 'Typographies' });
this.duplicateMainComponentMenuItem = page
.getByRole('menuitem')
.filter({ hasText: 'Duplicate main' });
Expand Down
12 changes: 7 additions & 5 deletions pages/workspace/main-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ exports.MainPage = class MainPage extends BasePage {
this.designTab = page.getByRole('tab', { name: 'design' });

//Viewport
this.textbox = page.locator('div[role="textbox"] div[contenteditable="true"]');
this.textbox = page.getByTestId('text-editor-content');
this.guides = page.locator('.guides .new-guides');
this.guidesFragment = page.locator('.main_ui_workspace_sidebar__resize-area');
this.gridEditorLabel = page.locator('input[class*="grid-editor-label"]');
Expand Down Expand Up @@ -895,7 +895,8 @@ exports.MainPage = class MainPage extends BasePage {
await this.page.waitForTimeout(2000);
await this.typeTextFromKeyboard();
} else {
await this.typeText('Hello World!');
await expect(this.textbox).toBeVisible();
await this.typeTextFromKeyboard();
}
await this.clickMoveButton();
await this.waitForChangeIsSaved();
Expand All @@ -911,7 +912,8 @@ exports.MainPage = class MainPage extends BasePage {
await this.page.waitForTimeout(400);
await this.typeTextFromKeyboard();
} else {
await this.typeText('Hello World!');
await expect(this.textbox).toBeVisible();
await this.typeTextFromKeyboard();
}
await this.clickMoveButton();
await this.waitForChangeIsSaved();
Expand Down Expand Up @@ -1081,13 +1083,13 @@ exports.MainPage = class MainPage extends BasePage {
await expect(this.workspaceMenu).not.toBeVisible();
}

async isColorsPaletteButtonVisible(visible = true){
async isColorsPaletteButtonVisible(visible = true) {
visible
? await expect(this.colorsPaletteButton).toBeVisible()
: await expect(this.colorsPaletteButton).not.toBeVisible();
}

async isTypographyButtonVisible(visible = true){
async isTypographyButtonVisible(visible = true) {
visible
? await expect(this.typographyButton).toBeVisible()
: await expect(this.typographyButton).not.toBeVisible();
Expand Down
3 changes: 3 additions & 0 deletions tests/panels-features/panels-features-pages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ mainTest(
await mainPage.clickOnPageOnLayersPanel(true);
await expect(mainPage.viewport).toHaveScreenshot(
'page-copies-component-update-main.png',
{
mask: [mainPage.guides, mainPage.guidesFragment, mainPage.toolBarWindow],
},
);
},
);

0 comments on commit 4f4b89c

Please sign in to comment.