forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPD-17801 Implement test that checks if client extension updates Allo…
…y Editor
- Loading branch information
1 parent
f4c7cf7
commit 9a51a16
Showing
3 changed files
with
102 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
modules/test/playwright/tests/client-extension-web/fixtures/editorSamplePageTest.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 | ||
*/ | ||
|
||
import {test} from '@playwright/test'; | ||
|
||
import {EditorsSamplePage} from '../pages/EditorsSamplePage'; | ||
|
||
const editorSamplePageTest = test.extend<{ | ||
editorSamplePage: EditorsSamplePage; | ||
}>({ | ||
editorSamplePage: async ({page}, use) => { | ||
await use(new EditorsSamplePage(page)); | ||
}, | ||
}); | ||
|
||
export {editorSamplePageTest}; |
28 changes: 28 additions & 0 deletions
28
modules/test/playwright/tests/client-extension-web/pages/EditorsSamplePage.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com | ||
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 | ||
*/ | ||
|
||
import {Locator, Page} from '@playwright/test'; | ||
|
||
export class EditorsSamplePage { | ||
readonly alloyEditorContainer: Locator; | ||
readonly alloyEditorToolbarContainer: Locator; | ||
readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.alloyEditorContainer = page.locator('.alloy-editor-container'); | ||
this.alloyEditorToolbarContainer = page.locator('.ae-toolbars'); | ||
|
||
this.page = page; | ||
} | ||
|
||
async selectTab({tabLabel}: {tabLabel: string}) { | ||
const tab = this.page.getByRole('tab', { | ||
exact: true, | ||
name: tabLabel, | ||
}); | ||
|
||
await tab.click(); | ||
} | ||
} |