Playwright_Java_Web_Testing/tests/example.spec.js

45 lines
1.3 KiB
JavaScript

// @ts-check
// const { test, expect } = require('@playwright/test');
// test.skip('homepage has title and links to intro page', async ({ page }) => {
// await page.goto('https://playwright.dev/');
// // Expect a title "to contain" a substring.
// await expect(page).toHaveTitle(/Playwright/);
// // create a locator
// const getStarted = page.getByRole('link', { name: 'Get started' });
// // Expect an attribute "to be strictly equal" to the value.
// await expect(getStarted).toHaveAttribute('href', '/docs/intro');
// // Click the get started link.
// await getStarted.click();
// // Expects the URL to contain intro.
// await expect(page).toHaveURL(/.*intro/);
// await page.pause();
// });
// test.skip('2', async ({ page }) => {
// await page.goto('https://playwright.dev/');
// // Expect a title "to contain" a substring.
// await expect(page).toHaveTitle(/Playwright/);
// // create a locator
// const getStarted = page.getByRole('link', { name: 'Get started' });
// // Expect an attribute "to be strictly equal" to the value.
// await expect(getStarted).toHaveAttribute('href', '/docs/intro');
// // Click the get started link.
// await getStarted.click();
// // Expects the URL to contain intro.
// await expect(page).toHaveURL(/.*intro/);
// await page.pause();
// });