Skip to content

Commit cb72b3b

Browse files
Cleanup: root .gitignore, unignore package-lock.json, npm ci, playwright --with-deps, JS examples (#33)
* Initial plan * Apply cleanup: root .gitignore, unignore package-lock.json, npm ci, playwright --with-deps, JS examples Co-authored-by: bg-playground <259109604+bg-playground@users.noreply.github.com> * Initial plan * Add package-lock.json for automated-testing directory Co-authored-by: bg-playground <259109604+bg-playground@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bg-playground <259109604+bg-playground@users.noreply.github.com>
1 parent 85fd567 commit cb72b3b

6 files changed

Lines changed: 118 additions & 17 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
- name: Install Node Dependencies
2525
working-directory: ./automated-testing
26-
run: npm install
26+
run: npm ci
2727

2828
- name: Install Playwright Browsers
2929
working-directory: ./automated-testing

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# OS files
2+
.DS_Store
3+
Thumbs.db
4+
5+
# IDE
6+
.vscode/
7+
.idea/
8+
*.swp
9+
*.swo
10+
11+
# Logs
12+
*.log

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ cd automated-testing
125125
npm install
126126

127127
# Install browsers
128-
npx playwright install
128+
npx playwright install --with-deps
129129

130130
# Run all tests
131131
npm test
@@ -269,7 +269,7 @@ cd TestingDemo-02
269269
```bash
270270
cd automated-testing
271271
npm install
272-
npx playwright install
272+
npx playwright install --with-deps
273273
npm test
274274
```
275275

automated-testing/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Dependencies
22
node_modules/
3-
package-lock.json
43

54
# Test results
65
test-results/

automated-testing/README.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

275272
test('Example Test', async ({ page }) => {
276273
const examplePage = new ExamplePage(page);

automated-testing/package-lock.json

Lines changed: 93 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)