Skip to content

Commit 95255c9

Browse files
committed
fix (playwright): webServer host
1 parent 9505b9f commit 95255c9

File tree

13 files changed

+19
-24
lines changed

13 files changed

+19
-24
lines changed

Diff for: examples/accessible-accordion/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -637,12 +637,12 @@ <h2>Code</h2>
637637
</p>
638638
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>
639639
</div>
640-
640+
641641
<script type="module">
642-
import { Accordion } from '../../index.js'
642+
import { Accordion } from '../../be-a11y.js'
643643
import '../../src/css/index.css'
644644
import './style.css'
645-
645+
646646
Accordion.preset = {
647647
'#accordion-demo-1': {},
648648
'#accordion-demo-2': { hasAnimation: true },

Diff for: examples/accessible-dropdown/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ <h2>Code</h2>
9898
</div>
9999

100100
<script type="module">
101-
import { Dropdown } from '../../index.js'
101+
import { Dropdown } from '../../be-a11y.js'
102102
import '../../src/css/index.css'
103103
import './style.css'
104104

Diff for: examples/accessible-modal/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ <h2 class="modal__title">Add delivery address</h2>
6868

6969
<h3>Modal button but only for &lt; 1024px devices</h3>
7070

71-
<button class="modal-btn--demo-2" type="button" aria-controls="demo-2">Add billing address</button>
71+
<button class="modal-btn--demo-2" type="button">Add billing address</button>
7272

73-
<div class="modal modal--mobile" tabindex="-1" role="dialog" aria-modal="true" style="display: none;">
73+
<div class="modal modal--mobile modal--demo-2" tabindex="-1" role="dialog" aria-modal="true" style="display: none;">
7474
<div class="modal__inner">
7575
<h2 class="modal__title">Add billing address</h2>
7676

@@ -126,7 +126,7 @@ <h2>Code</h2>
126126
</div>
127127

128128
<script type="module">
129-
import { Modal } from '../../index.js'
129+
import { Modal } from '../../be-a11y.js'
130130
import '../../src/css/index.css'
131131
import './style.css'
132132

Diff for: examples/accessible-slider/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ <h2>Code</h2>
5757
</div>
5858

5959
<script type="module">
60-
import { Slider } from '../../index.js'
60+
import { Slider } from '../../be-a11y.js'
6161
import '../../src/css/index.css'
6262
import './style.css'
6363

Diff for: examples/accessible-tabs/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ <h2>Code</h2>
9393
</div>
9494

9595
<script type="module">
96-
import { Tabs } from '../../index.js'
96+
import { Tabs } from '../../be-a11y.js'
9797
import '../../src/css/index.css'
9898
import './style.css'
9999

Diff for: examples/accessible-toggle/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ <h2>Code</h2>
6666
</div>
6767

6868
<script type="module">
69-
import { Toggle } from '../../index.js'
69+
import { Toggle } from '../../be-a11y.js'
7070
import '../../src/css/index.css'
7171
import './style.css'
7272

Diff for: playwright.config.ts

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {PlaywrightTestConfig, devices} from '@playwright/test'
2-
const viteConfig = require('./vite.config.ts')
32

43
const config: PlaywrightTestConfig = {
54
projects: [
@@ -9,15 +8,11 @@ const config: PlaywrightTestConfig = {
98
},
109
],
1110
webServer: {
12-
command: 'npx vite',
13-
url: 'http://127.0.0.1:5173/',
14-
reuseExistingServer: true,
11+
command: process.env.CI ? 'npx vite preview --port 5173' : 'npx vite dev',
12+
url: 'http://localhost:5173/',
13+
reuseExistingServer: !process.env.CI,
1514
timeout: 2000,
1615
},
17-
use: {
18-
ctPort: 8081,
19-
ctViteConfig: viteConfig,
20-
},
2116
}
2217

2318
module.exports = config

Diff for: src/classes/Accordion.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'
22

33
test.describe('Accordion', () => {
44
test.beforeEach(async({page}) => {
5-
await page.goto('http://127.0.0.1:5173/examples/accessible-accordion/index.html')
5+
await page.goto('http://localhost:5173/examples/accessible-accordion/index.html')
66
})
77

88
test('Click the first tab accordion, expect the first focusable element in the panel is focused.', async ({page}) => {

Diff for: src/classes/Dropdown.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'
22

33
test.describe('Dropdown', () => {
44
test.beforeEach(async({page}) => {
5-
await page.goto('http://127.0.0.1:5173/examples/accessible-dropdown/index.html')
5+
await page.goto('http://localhost:5173/examples/accessible-dropdown/index.html')
66
})
77

88
test('Click on the dropdown button, expect the listbox is visible.', async ({page}) => {

Diff for: src/classes/Modal.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'
22

33
test.describe('Modal', () => {
44
test.beforeEach(async({page}) => {
5-
await page.goto('http://127.0.0.1:5173/examples/accessible-modal/index.html')
5+
await page.goto('http://localhost:5173/examples/accessible-modal/index.html')
66
})
77

88
test('Click on a dialog trigger button, expect the modal dialog is visible.', async ({page}) => {

Diff for: src/classes/Slider.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'
22

33
test.describe('Slider', () => {
44
test.beforeEach(async({page}) => {
5-
await page.goto('http://127.0.0.1:5173/examples/accessible-slider/index.html')
5+
await page.goto('http://localhost:5173/examples/accessible-slider/index.html')
66
})
77

88
test('Click on next button, expect "data-dir" attribute is set to 1.', async ({page}) => {

Diff for: src/classes/Tabs.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'
22

33
test.describe('Tabs', () => {
44
test.beforeEach(async({page}) => {
5-
await page.goto('http://127.0.0.1:5173/examples/accessible-tabs/index.html')
5+
await page.goto('http://localhost:5173/examples/accessible-tabs/index.html')
66
})
77

88
test('Click on a tab, expect aria-selected attribute to be "true".', async ({page}) => {

Diff for: src/classes/Toggle.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { expect, test } from '@playwright/test'
22

33
test.describe('Toggle', () => {
44
test.beforeEach(async({page}) => {
5-
await page.goto('http://127.0.0.1:5173/examples/accessible-toggle/index.html')
5+
await page.goto('http://localhost:5173/examples/accessible-toggle/index.html')
66
})
77

88
test('Click on a toggle button, expect the content is visible.', async ({page}) => {

0 commit comments

Comments
 (0)