@@ -83,7 +83,7 @@ npm install
8383### 3. Install Playwright Browsers
8484
8585``` bash
86- npx playwright install
86+ npx playwright install --with-deps
8787```
8888
8989### 4. Configure Environment
@@ -218,8 +218,8 @@ jobs:
218218 test :
219219 runs-on : ubuntu-latest
220220 steps :
221- - uses : actions/checkout@v3
222- - uses : actions/setup-node@v3
221+ - uses : actions/checkout@v4
222+ - uses : actions/setup-node@v4
223223 with :
224224 node-version : ' 18'
225225 - name : Install dependencies
@@ -236,7 +236,7 @@ jobs:
236236 npm test
237237 - name : Upload test results
238238 if : always()
239- uses : actions/upload-artifact@v3
239+ uses : actions/upload-artifact@v4
240240 with :
241241 name : test-results
242242 path : automated-testing/test-results/
@@ -248,13 +248,8 @@ jobs:
248248
249249` ` ` javascript
250250// pages/ExamplePage.js
251- import { Page, Locator } from '@playwright/test';
252-
253- export class ExamplePage {
254- readonly page : Page;
255- readonly submitButton : Locator;
256-
257- constructor(page : Page) {
251+ class ExamplePage {
252+ constructor(page) {
258253 this.page = page;
259254 this.submitButton = page.getByRole('button', { name : ' Submit' });
260255 }
@@ -263,14 +258,16 @@ export class ExamplePage {
263258 await this.submitButton.click();
264259 }
265260}
261+
262+ module.exports = { ExamplePage };
266263```
267264
268265### Test Example
269266
270267``` javascript
271268// tests/ui/example.spec.js
272- import { test , expect } from ' @playwright/test' ;
273- import { ExamplePage } from ' ../../pages/ExamplePage' ;
269+ const { test , expect } = require ( ' @playwright/test' ) ;
270+ const { ExamplePage } = require ( ' ../../pages/ExamplePage' ) ;
274271
275272test (' Example Test' , async ({ page }) => {
276273 const examplePage = new ExamplePage (page);
0 commit comments