forked from writer/writer-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request writer#294 from raaymax/parallel-e2e-tests
tests: parallel e2e tests runner
- Loading branch information
Showing
10 changed files
with
202 additions
and
111 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
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
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
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
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
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,49 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
const createAndRemove = [ | ||
{ type: "sidebar", locator: `div.CoreSidebar.component` }, | ||
{ type: "section", locator: `section.CoreSection.component` }, | ||
{ type: "columns", locator: `div.CoreColumns.component` }, | ||
]; | ||
|
||
|
||
createAndRemove.forEach(({ type, locator }) => { | ||
test.describe(type, () => { | ||
const TYPE = type; | ||
const COMPONENT_LOCATOR = locator; | ||
const TARGET = ".CorePage"; | ||
let url: string; | ||
|
||
test.beforeAll(async ({request}) => { | ||
const response = await request.post(`/preset/empty_page`); | ||
expect(response.ok()).toBeTruthy(); | ||
({url} = await response.json()); | ||
}); | ||
|
||
test.afterAll(async ({request}) => { | ||
await request.delete(url); | ||
}); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await page.goto(url); | ||
}); | ||
|
||
test("create and remove", async ({ page }) => { | ||
await page | ||
.locator(`div.component.button[data-component-type="${TYPE}"]`) | ||
.dragTo(page.locator(TARGET)); | ||
await expect( | ||
page.locator(TARGET + " " + COMPONENT_LOCATOR), | ||
).toHaveCount(1); | ||
|
||
await page.locator(COMPONENT_LOCATOR).click(); | ||
await page | ||
.locator( | ||
'.BuilderComponentShortcuts .actionButton[data-automation-action="delete"]', | ||
) | ||
.click(); | ||
await expect(page.locator(COMPONENT_LOCATOR)).toHaveCount(0); | ||
}); | ||
}); | ||
}); | ||
|
Oops, something went wrong.