Skip to content

Commit 80add26

Browse files
committed
test: migrate Jasmine tests to Playwright
1 parent 7e805a6 commit 80add26

File tree

1 file changed

+10
-9
lines changed
  • tobago-example/tobago-example-demo/src/test/typescript/content/000-intro/03-intro

1 file changed

+10
-9
lines changed

tobago-example/tobago-example-demo/src/main/webapp/content/000-intro/03-intro/Intro.test.js renamed to tobago-example/tobago-example-demo/src/test/typescript/content/000-intro/03-intro/Intro.test.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,16 @@
1515
* limitations under the License.
1616
*/
1717

18-
import {elementByIdFn, querySelectorFn} from "/script/tobago-test.js";
19-
import {JasmineTestTool} from "/tobago/test/tobago-test-tool.js";
18+
import {expect, test} from "@playwright/test";
2019

21-
it("First section title is 'Intro'", function (done) {
22-
const titleOfFirstSectionHeader = querySelectorFn("tobago-section h1");
23-
const introLinkFn = elementByIdFn("page:navigation:nav:1:cmd");
20+
test.describe("000-intro/03-intro/Intro.xhtml", () => {
2421

25-
const test = new JasmineTestTool(done);
26-
test.setup(() => titleOfFirstSectionHeader().textContent.trim() === "Intro", null, "click", introLinkFn);
27-
test.do(() => expect(titleOfFirstSectionHeader().textContent.trim()).toEqual("Intro"));
28-
test.start();
22+
test.beforeEach(async ({page}) => {
23+
await page.goto("/content/000-intro/03-intro/Intro.xhtml");
24+
});
25+
26+
test("First section title is 'Intro'", async ({page}) => {
27+
const titleOfFirstSectionHeader = page.locator("tobago-section h1");
28+
await expect(titleOfFirstSectionHeader).toHaveText("Intro");
29+
});
2930
});

0 commit comments

Comments
 (0)