Fix test flake and playwright version in couchdb circleci test ()

* test: wait for `domcontentloaded` on reload

* chore: playwright `1.32.3` in circleci couchdb test

* test: simplify(why was this creating a clock??)
This commit is contained in:
Jesse Mazzella 2023-04-19 12:11:09 -07:00 committed by GitHub
parent 5610846147
commit ddeeff4822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 34 deletions
.circleci
e2e/tests/functional/plugins/notebook

View File

@ -162,7 +162,7 @@ jobs:
steps:
- build_and_install:
node-version: <<parameters.node-version>>
- run: npx playwright@1.29.0 install #Necessary for bare ubuntu machine
- run: npx playwright@1.32.3 install #Necessary for bare ubuntu machine
- run: |
export $(cat src/plugins/persistence/couch/.env.ci | xargs)
docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach

View File

@ -227,35 +227,11 @@ test.describe('Tagging in Notebooks @addInit', () => {
//Go to baseURL
await page.goto('./', { waitUntil: 'domcontentloaded' });
const clock = await createDomainObjectWithDefaults(page, { type: 'Clock' });
const ITERATIONS = 4;
const notebook = await createNotebookEntryAndTags(page, ITERATIONS);
await page.goto(notebook.url);
for (let iteration = 0; iteration < ITERATIONS; iteration++) {
const entryLocator = `[aria-label="Notebook Entry"] >> nth = ${iteration}`;
await expect(page.locator(entryLocator)).toContainText("Science");
await expect(page.locator(entryLocator)).toContainText("Driving");
}
await Promise.all([
page.waitForNavigation(),
page.goto('./#/browse/mine?hideTree=false'),
page.click('.c-disclosure-triangle')
]);
const treePane = page.getByRole('tree', {
name: 'Main Tree'
});
// Click Clock
await treePane.getByRole('treeitem', {
name: clock.name
}).click();
// Click Notebook
await page.getByRole('treeitem', {
name: notebook.name
}).click();
// Verify tags are present
for (let iteration = 0; iteration < ITERATIONS; iteration++) {
const entryLocator = `[aria-label="Notebook Entry"] >> nth = ${iteration}`;
await expect(page.locator(entryLocator)).toContainText("Science");
@ -263,14 +239,9 @@ test.describe('Tagging in Notebooks @addInit', () => {
}
//Reload Page
await Promise.all([
page.reload(),
page.waitForLoadState('networkidle')
]);
// Click Notebook
await page.click(`text="${notebook.name}"`);
await page.reload({ waitUntil: 'domcontentloaded' });
// Verify tags persist across reload
for (let iteration = 0; iteration < ITERATIONS; iteration++) {
const entryLocator = `[aria-label="Notebook Entry"] >> nth = ${iteration}`;
await expect(page.locator(entryLocator)).toContainText("Science");