use a fresh dev server for each test
This commit is contained in:
parent
8dd5b23181
commit
afd1b07a95
10 changed files with 114 additions and 92 deletions
|
@ -10,20 +10,16 @@ const test = base.extend({
|
||||||
|
|
||||||
let devServer;
|
let devServer;
|
||||||
|
|
||||||
test.beforeAll(async ({ astro }) => {
|
test.beforeEach(async ({ astro }) => {
|
||||||
devServer = await astro.startDevServer();
|
devServer = await astro.startDevServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ astro }) => {
|
test.afterEach(async () => {
|
||||||
await devServer.stop();
|
await devServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterEach(async ({ astro }) => {
|
test.describe('Lit', () => {
|
||||||
astro.clean();
|
test('client:idle', async ({ page, astro }) => {
|
||||||
});
|
|
||||||
|
|
||||||
test.only('Lit', async ({ page, astro }) => {
|
|
||||||
await test.step('client:idle', async () => {
|
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-idle');
|
const counter = page.locator('#client-idle');
|
||||||
|
@ -38,7 +34,7 @@ test.only('Lit', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('Count: 1');
|
await expect(count).toHaveText('Count: 1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:load', async () => {
|
test('client:load', async ({ page, astro }) => {
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-load');
|
const counter = page.locator('#client-load');
|
||||||
|
@ -53,7 +49,7 @@ test.only('Lit', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('Count: 1');
|
await expect(count).toHaveText('Count: 1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:visible', async () => {
|
test('client:visible', async ({ page, astro }) => {
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-visible');
|
const counter = page.locator('#client-visible');
|
||||||
|
@ -69,7 +65,7 @@ test.only('Lit', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('Count: 1');
|
await expect(count).toHaveText('Count: 1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:media', async () => {
|
test('client:media', async ({ page, astro }) => {
|
||||||
await page.goto(astro.resolveUrl('/media'));
|
await page.goto(astro.resolveUrl('/media'));
|
||||||
|
|
||||||
const counter = page.locator('#client-media');
|
const counter = page.locator('#client-media');
|
||||||
|
@ -89,7 +85,7 @@ test.only('Lit', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('Count: 1');
|
await expect(count).toHaveText('Count: 1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('HMR', async () => {
|
test('HMR', async ({ page, astro }) => {
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
// test 1: updating the page component
|
// test 1: updating the page component
|
||||||
|
|
|
@ -10,18 +10,18 @@ const test = base.extend({
|
||||||
|
|
||||||
let devServer;
|
let devServer;
|
||||||
|
|
||||||
test.beforeAll(async ({ astro }) => {
|
test.beforeEach(async ({ astro }) => {
|
||||||
devServer = await astro.startDevServer();
|
devServer = await astro.startDevServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ astro }) => {
|
test.afterEach(async () => {
|
||||||
await devServer.stop();
|
await devServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Loading styles that are nested', async ({ page, astro }) => {
|
test.describe('Loading styles that are nested', () => {
|
||||||
|
test('header', async ({ page, astro }) => {
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
await test.step('header', async () => {
|
|
||||||
const header = page.locator('header');
|
const header = page.locator('header');
|
||||||
|
|
||||||
await expect(header, 'should have background color').toHaveCSS(
|
await expect(header, 'should have background color').toHaveCSS(
|
||||||
|
|
|
@ -10,22 +10,18 @@ const test = base.extend({
|
||||||
|
|
||||||
let devServer;
|
let devServer;
|
||||||
|
|
||||||
test.beforeAll(async ({ astro }) => {
|
test.beforeEach(async ({ astro }) => {
|
||||||
devServer = await astro.startDevServer();
|
devServer = await astro.startDevServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ astro }) => {
|
test.afterEach(async () => {
|
||||||
await devServer.stop();
|
await devServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterEach(async ({ astro }) => {
|
test.describe('Preact', () => {
|
||||||
astro.clean();
|
test('server only', async ({ page, astro }) => {
|
||||||
});
|
|
||||||
|
|
||||||
test.only('Preact', async ({ page, astro }) => {
|
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
await test.step('server only', async () => {
|
|
||||||
const counter = page.locator('#server-only');
|
const counter = page.locator('#server-only');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -38,7 +34,9 @@ test.only('Preact', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('0');
|
await expect(count).toHaveText('0');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:idle', async () => {
|
test('client:idle', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-idle');
|
const counter = page.locator('#client-idle');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -51,7 +49,9 @@ test.only('Preact', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:load', async () => {
|
test('client:load', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-load');
|
const counter = page.locator('#client-load');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -64,7 +64,9 @@ test.only('Preact', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:visible', async () => {
|
test('client:visible', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-visible');
|
const counter = page.locator('#client-visible');
|
||||||
await counter.scrollIntoViewIfNeeded();
|
await counter.scrollIntoViewIfNeeded();
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
@ -78,7 +80,9 @@ test.only('Preact', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:media', async () => {
|
test('client:media', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-media');
|
const counter = page.locator('#client-media');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -96,14 +100,18 @@ test.only('Preact', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:only', async () => {
|
test('client:only', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const label = page.locator('#client-only');
|
const label = page.locator('#client-only');
|
||||||
await expect(label).toBeVisible();
|
await expect(label).toBeVisible();
|
||||||
|
|
||||||
await expect(label).toHaveText('Preact client:only component');
|
await expect(label).toHaveText('Preact client:only component');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('HMR', async () => {
|
test('HMR', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
// test 1: updating the page component
|
// test 1: updating the page component
|
||||||
await astro.editFile(
|
await astro.editFile(
|
||||||
'./src/pages/index.astro',
|
'./src/pages/index.astro',
|
||||||
|
|
|
@ -10,22 +10,18 @@ const test = base.extend({
|
||||||
|
|
||||||
let devServer;
|
let devServer;
|
||||||
|
|
||||||
test.beforeAll(async ({ astro }) => {
|
test.beforeEach(async ({ astro }) => {
|
||||||
devServer = await astro.startDevServer();
|
devServer = await astro.startDevServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ astro }) => {
|
test.afterEach(async () => {
|
||||||
await devServer.stop();
|
await devServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterEach(async ({ astro }) => {
|
test.describe('React', () => {
|
||||||
astro.clean();
|
test('server only', async ({ page, astro }) => {
|
||||||
});
|
|
||||||
|
|
||||||
test.only('React', async ({ page, astro }) => {
|
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
await test.step('server only', async () => {
|
|
||||||
const counter = page.locator('#server-only');
|
const counter = page.locator('#server-only');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -38,7 +34,9 @@ test.only('React', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('0');
|
await expect(count).toHaveText('0');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:idle', async () => {
|
test('client:idle', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-idle');
|
const counter = page.locator('#client-idle');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -51,7 +49,9 @@ test.only('React', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:load', async () => {
|
test('client:load', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-load');
|
const counter = page.locator('#client-load');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -64,7 +64,9 @@ test.only('React', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:visible', async () => {
|
test('client:visible', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-visible');
|
const counter = page.locator('#client-visible');
|
||||||
await counter.scrollIntoViewIfNeeded();
|
await counter.scrollIntoViewIfNeeded();
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
@ -78,7 +80,9 @@ test.only('React', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:media', async () => {
|
test('client:media', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-media');
|
const counter = page.locator('#client-media');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -96,14 +100,18 @@ test.only('React', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:only', async () => {
|
test('client:only', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const label = page.locator('#client-only');
|
const label = page.locator('#client-only');
|
||||||
await expect(label).toBeVisible();
|
await expect(label).toBeVisible();
|
||||||
|
|
||||||
await expect(label).toHaveText('React client:only component');
|
await expect(label).toHaveText('React client:only component');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('HMR', async () => {
|
test('HMR', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
// test 1: updating the page component
|
// test 1: updating the page component
|
||||||
await astro.editFile(
|
await astro.editFile(
|
||||||
'./src/pages/index.astro',
|
'./src/pages/index.astro',
|
||||||
|
|
|
@ -10,22 +10,18 @@ const test = base.extend({
|
||||||
|
|
||||||
let devServer;
|
let devServer;
|
||||||
|
|
||||||
test.beforeAll(async ({ astro }) => {
|
test.beforeEach(async ({ astro }) => {
|
||||||
devServer = await astro.startDevServer();
|
devServer = await astro.startDevServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ astro }) => {
|
test.afterEach(async () => {
|
||||||
await devServer.stop();
|
await devServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterEach(async ({ astro }) => {
|
test.describe('Svelte', () => {
|
||||||
astro.clean();
|
test('server only', async ({ page, astro }) => {
|
||||||
});
|
|
||||||
|
|
||||||
test.only('Svelte', async ({ page, astro }) => {
|
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
await test.step('server only', async () => {
|
|
||||||
const counter = page.locator('#server-only');
|
const counter = page.locator('#server-only');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -38,7 +34,9 @@ test.only('Svelte', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('0');
|
await expect(count).toHaveText('0');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:idle', async () => {
|
test('client:idle', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-idle');
|
const counter = page.locator('#client-idle');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -51,7 +49,9 @@ test.only('Svelte', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:load', async () => {
|
test('client:load', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-load');
|
const counter = page.locator('#client-load');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -64,7 +64,9 @@ test.only('Svelte', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:visible', async () => {
|
test('client:visible', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-visible');
|
const counter = page.locator('#client-visible');
|
||||||
await counter.scrollIntoViewIfNeeded();
|
await counter.scrollIntoViewIfNeeded();
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
@ -78,7 +80,9 @@ test.only('Svelte', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:media', async () => {
|
test('client:media', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-media');
|
const counter = page.locator('#client-media');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -96,7 +100,9 @@ test.only('Svelte', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('HMR', async () => {
|
test('HMR', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
// test 1: updating the page component
|
// test 1: updating the page component
|
||||||
await astro.editFile(
|
await astro.editFile(
|
||||||
'./src/pages/index.astro',
|
'./src/pages/index.astro',
|
||||||
|
|
|
@ -10,22 +10,18 @@ const test = base.extend({
|
||||||
|
|
||||||
let devServer;
|
let devServer;
|
||||||
|
|
||||||
test.beforeAll(async ({ astro }) => {
|
test.beforeEach(async ({ astro }) => {
|
||||||
devServer = await astro.startDevServer();
|
devServer = await astro.startDevServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ astro }) => {
|
test.afterEach(async () => {
|
||||||
await devServer.stop();
|
await devServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterEach(async ({ astro }) => {
|
test.describe('Tailwind CSS', () => {
|
||||||
astro.clean();
|
test('body', async ({ page, astro }) => {
|
||||||
});
|
|
||||||
|
|
||||||
test('Tailwind CSS', async ({ page, astro }) => {
|
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
await test.step('body', async () => {
|
|
||||||
const body = page.locator('body');
|
const body = page.locator('body');
|
||||||
|
|
||||||
await expect(body, 'should have classes').toHaveClass('bg-dawn text-midnight');
|
await expect(body, 'should have classes').toHaveClass('bg-dawn text-midnight');
|
||||||
|
@ -36,7 +32,9 @@ test('Tailwind CSS', async ({ page, astro }) => {
|
||||||
await expect(body, 'should have color').toHaveCSS('color', 'rgb(49, 39, 74)');
|
await expect(body, 'should have color').toHaveCSS('color', 'rgb(49, 39, 74)');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('button', async () => {
|
test('button', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const button = page.locator('button');
|
const button = page.locator('button');
|
||||||
|
|
||||||
await expect(button, 'should have bg-purple-600').toHaveClass(/bg-purple-600/);
|
await expect(button, 'should have bg-purple-600').toHaveClass(/bg-purple-600/);
|
||||||
|
@ -53,7 +51,9 @@ test('Tailwind CSS', async ({ page, astro }) => {
|
||||||
await expect(button, 'should have font weight').toHaveCSS('font-weight', '900');
|
await expect(button, 'should have font weight').toHaveCSS('font-weight', '900');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('HMR', async () => {
|
test('HMR', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
await astro.editFile(
|
await astro.editFile(
|
||||||
'./src/components/Button.astro',
|
'./src/components/Button.astro',
|
||||||
(original) => original.replace('bg-purple-600', 'bg-purple-400')
|
(original) => original.replace('bg-purple-600', 'bg-purple-400')
|
||||||
|
|
|
@ -10,22 +10,18 @@ const test = base.extend({
|
||||||
|
|
||||||
let devServer;
|
let devServer;
|
||||||
|
|
||||||
test.beforeAll(async ({ astro }) => {
|
test.beforeEach(async ({ astro }) => {
|
||||||
devServer = await astro.startDevServer();
|
devServer = await astro.startDevServer();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterAll(async ({ astro }) => {
|
test.afterEach(async () => {
|
||||||
await devServer.stop();
|
await devServer.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.afterEach(async ({ astro }) => {
|
test.describe('Vue', () => {
|
||||||
astro.clean();
|
test('server only', async ({ page, astro }) => {
|
||||||
});
|
|
||||||
|
|
||||||
test.only('Vue', async ({ page, astro }) => {
|
|
||||||
await page.goto(astro.resolveUrl('/'));
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
await test.step('server only', async () => {
|
|
||||||
const counter = page.locator('#server-only');
|
const counter = page.locator('#server-only');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -38,7 +34,9 @@ test.only('Vue', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('0');
|
await expect(count).toHaveText('0');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:idle', async () => {
|
test('client:idle', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-idle');
|
const counter = page.locator('#client-idle');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -51,7 +49,9 @@ test.only('Vue', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:load', async () => {
|
test('client:load', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-load');
|
const counter = page.locator('#client-load');
|
||||||
const counterDup = page.locator('#client-load-dup');
|
const counterDup = page.locator('#client-load-dup');
|
||||||
const counterStep = page.locator('#client-load-step');
|
const counterStep = page.locator('#client-load-step');
|
||||||
|
@ -88,7 +88,9 @@ test.only('Vue', async ({ page, astro }) => {
|
||||||
await expect(countStep).toHaveText('4');
|
await expect(countStep).toHaveText('4');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:visible', async () => {
|
test('client:visible', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-visible');
|
const counter = page.locator('#client-visible');
|
||||||
await counter.scrollIntoViewIfNeeded();
|
await counter.scrollIntoViewIfNeeded();
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
@ -104,7 +106,9 @@ test.only('Vue', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('client:media', async () => {
|
test('client:media', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
const counter = page.locator('#client-media');
|
const counter = page.locator('#client-media');
|
||||||
await expect(counter).toBeVisible();
|
await expect(counter).toBeVisible();
|
||||||
|
|
||||||
|
@ -122,7 +126,9 @@ test.only('Vue', async ({ page, astro }) => {
|
||||||
await expect(count).toHaveText('1');
|
await expect(count).toHaveText('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
await test.step('HMR', async () => {
|
test('HMR', async ({ page, astro }) => {
|
||||||
|
await page.goto(astro.resolveUrl('/'));
|
||||||
|
|
||||||
// test 1: updating the page component
|
// test 1: updating the page component
|
||||||
await astro.editFile(
|
await astro.editFile(
|
||||||
'./src/pages/index.astro',
|
'./src/pages/index.astro',
|
||||||
|
|
|
@ -73,8 +73,8 @@
|
||||||
"benchmark": "node test/benchmark/dev.bench.js && node test/benchmark/build.bench.js",
|
"benchmark": "node test/benchmark/dev.bench.js && node test/benchmark/build.bench.js",
|
||||||
"test": "mocha --exit --timeout 20000 --ignore **/lit-element.test.js --ignore **/errors.test.js && mocha --timeout 20000 **/lit-element.test.js && mocha --timeout 20000 **/errors.test.js",
|
"test": "mocha --exit --timeout 20000 --ignore **/lit-element.test.js --ignore **/errors.test.js && mocha --timeout 20000 **/lit-element.test.js && mocha --timeout 20000 **/errors.test.js",
|
||||||
"test:match": "mocha --timeout 20000 -g",
|
"test:match": "mocha --timeout 20000 -g",
|
||||||
"test:e2e": "playwright test -c ./playwright.config.ts",
|
"test:e2e": "playwright test",
|
||||||
"test:e2e:match": "playwright test -c ./playwright.config.ts -g"
|
"test:e2e:match": "playwright test -g"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@astrojs/compiler": "^0.14.3",
|
"@astrojs/compiler": "^0.14.3",
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
import type { PlaywrightTestConfig } from '@playwright/test';
|
const config = {
|
||||||
|
testMatch: 'e2e/*.test.js',
|
||||||
const config: PlaywrightTestConfig = {
|
|
||||||
testMatch: 'e2e/*.test.ts',
|
|
||||||
projects: [
|
projects: [
|
||||||
{
|
{
|
||||||
name: 'Chrome Stable',
|
name: 'Chrome Stable',
|
Loading…
Reference in a new issue