alessandro trinca tornidor
commited on
Commit
·
b5b3e0a
1
Parent(s):
d0fef9b
test: update test case 2 and 3
Browse files- static/tests/test-classic-3-lite.koboldai.net.spec.ts +25 -4
- static/tests/test-classic-3-lite.koboldai.net.spec.ts-snapshots/test-classic-3-0-wordsearch-results-0-0-chromium.txt +3 -0
- static/tests/test-classic-3-lite.koboldai.net.spec.ts-snapshots/test-classic-3-0-wordsearch-results-0-1-chromium.txt +3 -0
- static/tests/test-classic-3-lite.koboldai.net.spec.ts-snapshots/test-classic-3-0-wordsearch-results-1-0-chromium.txt +3 -0
- static/tests/test-classic-3-lite.koboldai.net.spec.ts-snapshots/test-classic-3-0-wordsearch-results-1-1-chromium.txt +3 -0
static/tests/test-classic-3-lite.koboldai.net.spec.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import { test, expect, Page, TestInfo, chromium, devices } from '@playwright/test';
|
| 2 |
-
import { initTest } from './test-helper';
|
| 3 |
|
| 4 |
const testStoryJsonTxt = `${import.meta.dirname}/../../tests/events/very_long_text.json`
|
| 5 |
|
|
@@ -7,6 +7,7 @@ test(`test My Ghost Writer: assert no wrong DOM dynamic construction within the
|
|
| 7 |
by trigger_wordsearch_candidates() after click on div elements created by trigger_wordsearch_results(),
|
| 8 |
both in read-only and editable mode. No query`, async ({ page }: { page: Page }, workerInfo: TestInfo) => {
|
| 9 |
|
|
|
|
| 10 |
const projectName = await initTest({ page, workerInfo, filepath: testStoryJsonTxt })
|
| 11 |
|
| 12 |
for (let idx = 0; idx < 2; idx++) {
|
|
@@ -14,7 +15,6 @@ test(`test My Ghost Writer: assert no wrong DOM dynamic construction within the
|
|
| 14 |
await page.getByRole('checkbox', { name: 'Allow Editing' }).check();
|
| 15 |
await page.waitForTimeout(100)
|
| 16 |
await expect(page.getByRole('checkbox', { name: 'Allow Editing' })).toBeChecked()
|
| 17 |
-
await page.waitForTimeout(100)
|
| 18 |
await page.getByRole('searchbox', { name: 'Word Search Input' }).click();
|
| 19 |
await page.getByRole('searchbox', { name: 'Word Search Input' }).fill('');
|
| 20 |
await page.getByRole('searchbox', { name: 'Word Search Input' }).press('Enter');
|
|
@@ -31,15 +31,29 @@ test(`test My Ghost Writer: assert no wrong DOM dynamic construction within the
|
|
| 31 |
await page.waitForTimeout(100)
|
| 32 |
await page.locator('#wordsearch_results div').first().click();
|
| 33 |
await page.waitForTimeout(100)
|
|
|
|
| 34 |
await page.getByLabel('id-div-0-range-0-nth').click();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
await page.waitForTimeout(100)
|
| 36 |
-
await page.getByLabel('id-div-0-range-1-nth').click();
|
| 37 |
}
|
| 38 |
}
|
| 39 |
await page.close()
|
| 40 |
})
|
| 41 |
|
| 42 |
-
|
| 43 |
test(`test My Ghost Writer: assert no wrong DOM dynamic construction within the div "wordsearch_results"
|
| 44 |
by trigger_wordsearch_candidates() after click on div elements created by trigger_wordsearch_results(),
|
| 45 |
both in read-only and editable mode. Using query 'good-for-'`,
|
|
@@ -88,12 +102,19 @@ test(`test My Ghost Writer: assert no wrong DOM dynamic construction within the
|
|
| 88 |
await page.waitForTimeout(100)
|
| 89 |
await page.locator('#wordsearch_results div').first().click();
|
| 90 |
await page.waitForTimeout(100)
|
|
|
|
| 91 |
if (projectName === "MobileChromeLandscape") {
|
| 92 |
await page.getByRole("link", {name: "id-0-range-0-nth"}).click()
|
| 93 |
} else {
|
| 94 |
await page.getByLabel('id-div-0-range-0-nth').click();
|
| 95 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
await page.waitForTimeout(100)
|
| 97 |
}
|
| 98 |
}
|
|
|
|
| 99 |
})
|
|
|
|
| 1 |
import { test, expect, Page, TestInfo, chromium, devices } from '@playwright/test';
|
| 2 |
+
import { ensureThesaurusPanelClosed, ensureThesaurusPanelOpen, initTest } from './test-helper';
|
| 3 |
|
| 4 |
const testStoryJsonTxt = `${import.meta.dirname}/../../tests/events/very_long_text.json`
|
| 5 |
|
|
|
|
| 7 |
by trigger_wordsearch_candidates() after click on div elements created by trigger_wordsearch_results(),
|
| 8 |
both in read-only and editable mode. No query`, async ({ page }: { page: Page }, workerInfo: TestInfo) => {
|
| 9 |
|
| 10 |
+
test.slow()
|
| 11 |
const projectName = await initTest({ page, workerInfo, filepath: testStoryJsonTxt })
|
| 12 |
|
| 13 |
for (let idx = 0; idx < 2; idx++) {
|
|
|
|
| 15 |
await page.getByRole('checkbox', { name: 'Allow Editing' }).check();
|
| 16 |
await page.waitForTimeout(100)
|
| 17 |
await expect(page.getByRole('checkbox', { name: 'Allow Editing' })).toBeChecked()
|
|
|
|
| 18 |
await page.getByRole('searchbox', { name: 'Word Search Input' }).click();
|
| 19 |
await page.getByRole('searchbox', { name: 'Word Search Input' }).fill('');
|
| 20 |
await page.getByRole('searchbox', { name: 'Word Search Input' }).press('Enter');
|
|
|
|
| 31 |
await page.waitForTimeout(100)
|
| 32 |
await page.locator('#wordsearch_results div').first().click();
|
| 33 |
await page.waitForTimeout(100)
|
| 34 |
+
await ensureThesaurusPanelClosed(page);
|
| 35 |
await page.getByLabel('id-div-0-range-0-nth').click();
|
| 36 |
+
await ensureThesaurusPanelOpen(page);
|
| 37 |
+
|
| 38 |
+
await page.getByRole('button', { name: 'id-rightpanel-thesaurus-close' }).click();
|
| 39 |
+
await page.waitForTimeout(100)
|
| 40 |
+
await ensureThesaurusPanelClosed(page);
|
| 41 |
+
|
| 42 |
+
await page.getByLabel('id-div-candidate-10-nth').click();
|
| 43 |
+
await page.waitForTimeout(100)
|
| 44 |
+
const idDiv0range1 = page.getByLabel('id-div-10-range-1-nth')
|
| 45 |
+
await expect(idDiv0range1).toMatchAriaSnapshot({ name: `test-classic-3-0-wordsearch_results-${idx}-${step}-${projectName}.txt` });
|
| 46 |
+
await idDiv0range1.click();
|
| 47 |
+
await ensureThesaurusPanelOpen(page);
|
| 48 |
+
|
| 49 |
+
await page.getByRole('button', { name: 'id-rightpanel-thesaurus-close' }).click();
|
| 50 |
+
await ensureThesaurusPanelClosed(page);
|
| 51 |
await page.waitForTimeout(100)
|
|
|
|
| 52 |
}
|
| 53 |
}
|
| 54 |
await page.close()
|
| 55 |
})
|
| 56 |
|
|
|
|
| 57 |
test(`test My Ghost Writer: assert no wrong DOM dynamic construction within the div "wordsearch_results"
|
| 58 |
by trigger_wordsearch_candidates() after click on div elements created by trigger_wordsearch_results(),
|
| 59 |
both in read-only and editable mode. Using query 'good-for-'`,
|
|
|
|
| 102 |
await page.waitForTimeout(100)
|
| 103 |
await page.locator('#wordsearch_results div').first().click();
|
| 104 |
await page.waitForTimeout(100)
|
| 105 |
+
await ensureThesaurusPanelClosed(page);
|
| 106 |
if (projectName === "MobileChromeLandscape") {
|
| 107 |
await page.getByRole("link", {name: "id-0-range-0-nth"}).click()
|
| 108 |
} else {
|
| 109 |
await page.getByLabel('id-div-0-range-0-nth').click();
|
| 110 |
}
|
| 111 |
+
await ensureThesaurusPanelOpen(page);
|
| 112 |
+
await page.waitForTimeout(100)
|
| 113 |
+
|
| 114 |
+
await page.getByRole('button', { name: 'id-rightpanel-thesaurus-close' }).click();
|
| 115 |
+
await ensureThesaurusPanelClosed(page);
|
| 116 |
await page.waitForTimeout(100)
|
| 117 |
}
|
| 118 |
}
|
| 119 |
+
await page.close()
|
| 120 |
})
|
static/tests/test-classic-3-lite.koboldai.net.spec.ts-snapshots/test-classic-3-0-wordsearch-results-0-0-chromium.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- link /id-\d+-range-1-nth/:
|
| 2 |
+
- /url: "#"
|
| 3 |
+
- text: called Harry. Come to
|
static/tests/test-classic-3-lite.koboldai.net.spec.ts-snapshots/test-classic-3-0-wordsearch-results-0-1-chromium.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- link /id-\d+-range-1-nth/:
|
| 2 |
+
- /url: "#"
|
| 3 |
+
- text: called Harry. Come to
|
static/tests/test-classic-3-lite.koboldai.net.spec.ts-snapshots/test-classic-3-0-wordsearch-results-1-0-chromium.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- link /id-\d+-range-1-nth/:
|
| 2 |
+
- /url: "#"
|
| 3 |
+
- text: called Harry. Come to
|
static/tests/test-classic-3-lite.koboldai.net.spec.ts-snapshots/test-classic-3-0-wordsearch-results-1-1-chromium.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
- link /id-\d+-range-1-nth/:
|
| 2 |
+
- /url: "#"
|
| 3 |
+
- text: called Harry. Come to
|