Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/test-runner-commands/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
},
"scripts": {
"build": "tsc",
"test:node": "mocha test/**/*.test.ts --require ts-node/register --reporter dot",
"test:watch": "mocha test/**/*.test.ts --require ts-node/register --watch --watch-files src,test --watch-ignore **/*.snap.js"
"test:node": "node --experimental-strip-types --test --test-force-exit test/**/*.test.ts",
"test:watch": "node --experimental-strip-types --test --test-force-exit --watch test/**/*.test.ts"
},
"files": [
"*.d.ts",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { describe, it } from 'node:test';
import path from 'path';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';
import { playwrightLauncher } from '@web/test-runner-playwright';

import { a11ySnapshotPlugin } from '../../src/a11ySnapshotPlugin.js';

describe('a11ySnapshotPlugin', function test() {
this.timeout(20000);
import { a11ySnapshotPlugin } from '../../dist/a11ySnapshotPlugin.js';

describe('a11ySnapshotPlugin', { timeout: 20000 }, () => {
it('can find accessibility nodes in the returned accessibility tree on puppeteer', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [chromeLauncher()],
plugins: [a11ySnapshotPlugin()],
});
});

it('can find accessibility nodes in the returned accessibility tree on playwright', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import { describe, it } from 'node:test';
import path from 'path';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';
import { playwrightLauncher } from '@web/test-runner-playwright';

import { emulateMediaPlugin } from '../../src/emulateMediaPlugin.js';

describe('emulateMediaPlugin', function test() {
this.timeout(20000);
import { emulateMediaPlugin } from '../../dist/emulateMediaPlugin.js';

describe('emulateMediaPlugin', { timeout: 20000 }, () => {
it('can emulate media on puppeteer', async () => {
await runTests({
files: [
path.join(__dirname, 'browser-test.js'),
path.join(__dirname, 'prefers-reduced-motion-test.js'),
path.join(import.meta.dirname, 'browser-test.js'),
path.join(import.meta.dirname, 'prefers-reduced-motion-test.js'),
],

browsers: [chromeLauncher()],
Expand All @@ -23,8 +22,8 @@ describe('emulateMediaPlugin', function test() {
it('can emulate media on playwright', async () => {
await runTests({
files: [
path.join(__dirname, 'browser-test.js'),
path.join(__dirname, 'prefers-reduced-motion-test.js'),
path.join(import.meta.dirname, 'browser-test.js'),
path.join(import.meta.dirname, 'prefers-reduced-motion-test.js'),
],
browsers: [
playwrightLauncher({ product: 'chromium' }),
Expand All @@ -37,7 +36,7 @@ describe('emulateMediaPlugin', function test() {

it('can emulate forced-colors on playwright, except webkit', async () => {
await runTests({
files: [path.join(__dirname, 'forced-colors-test.js')],
files: [path.join(import.meta.dirname, 'forced-colors-test.js')],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { describe, it } from 'node:test';
import path from 'path';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';
import type { Logger } from '@web/dev-server-core';

describe('executeServerCommand', function test() {
this.timeout(20000);

describe('executeServerCommand', { timeout: 20000 }, () => {
it('can execute commands', async () => {
const logger: Logger = {
...console,
Expand All @@ -26,7 +25,7 @@ describe('executeServerCommand', function test() {
};

await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
logger,
browsers: [chromeLauncher()],
plugins: [
Expand Down
9 changes: 4 additions & 5 deletions packages/test-runner-commands/test/file/filePlugin.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { describe, it } from 'node:test';
import path from 'path';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';

import { filePlugin } from '../../src/filePlugin.js';

describe('filePlugin', function test() {
this.timeout(20000);
import { filePlugin } from '../../dist/filePlugin.js';

describe('filePlugin', { timeout: 20000 }, () => {
it('passes file plugin tests', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [chromeLauncher()],
plugins: [filePlugin()],
logger: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { describe, it } from 'node:test';
import path from 'path';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';
import { playwrightLauncher } from '@web/test-runner-playwright';

import { selectOptionPlugin } from '../../src/selectOptionPlugin.js';

describe('selectOptionPlugin', function test() {
this.timeout(20000);
import { selectOptionPlugin } from '../../dist/selectOptionPlugin.js';

describe('selectOptionPlugin', { timeout: 20000 }, () => {
it('can send keys on puppeteer', async () => {
await runTests({
files: [path.join(__dirname, 'puppeteer-test.js')],
files: [path.join(import.meta.dirname, 'puppeteer-test.js')],
browsers: [chromeLauncher()],
plugins: [selectOptionPlugin()],
});
});

it('can send keys on playwright', async () => {
await runTests({
files: [path.join(__dirname, 'playwright-test.js')],
files: [path.join(import.meta.dirname, 'playwright-test.js')],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
import { describe, it } from 'node:test';
import path from 'path';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';
import { playwrightLauncher } from '@web/test-runner-playwright';

import { sendKeysPlugin } from '../../src/sendKeysPlugin.js';

describe('sendKeysPlugin', function test() {
this.timeout(20000);
import { sendKeysPlugin } from '../../dist/sendKeysPlugin.js';

describe('sendKeysPlugin', { timeout: 20000 }, () => {
it('can send keys on puppeteer', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [chromeLauncher()],
plugins: [sendKeysPlugin()],
});
});

it('can send keys on playwright', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
import { describe, it, before, after } from 'node:test';
import path from 'path';
import selenium from 'selenium-standalone';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';
import { webdriverLauncher } from '@web/test-runner-webdriver';
import { playwrightLauncher } from '@web/test-runner-playwright';
import { sendMousePlugin } from '../../src/sendMousePlugin.js';
import { startSeleniumServer } from '../selenium-server.js';

describe('sendMousePlugin', function test() {
this.timeout(50000);
import { sendMousePlugin } from '../../dist/sendMousePlugin.js';
import { startSeleniumServer } from '../selenium-server.ts';

describe('sendMousePlugin', { timeout: 50000 }, () => {
it('can send mouse on puppeteer', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [chromeLauncher()],
plugins: [sendMousePlugin()],
});
});

it('can send mouse on playwright', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
Expand Down Expand Up @@ -52,7 +51,7 @@ describe('sendMousePlugin', function test() {

it('can send mouse on webdriver', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
concurrency: 1,
browsers: [
webdriverLauncher({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { describe, it } from 'node:test';
import path from 'path';
import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';

import { setUserAgentPlugin } from '../../src/setUserAgentPlugin.js';

describe('setUserAgentPlugin', function test() {
this.timeout(20000);
import { setUserAgentPlugin } from '../../dist/setUserAgentPlugin.js';

describe('setUserAgentPlugin', { timeout: 20000 }, () => {
it('can set the user agent on puppeteer', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [chromeLauncher()],
plugins: [setUserAgentPlugin()],
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import { describe, it } from 'node:test';
import path from 'path';

import { runTests } from '@web/test-runner-core/test-helpers';
import { chromeLauncher } from '@web/test-runner-chrome';
import { playwrightLauncher } from '@web/test-runner-playwright';

import { setViewportPlugin } from '../../src/setViewportPlugin.js';

describe('setViewportPlugin', function test() {
this.timeout(20000);
import { setViewportPlugin } from '../../dist/setViewportPlugin.js';

describe('setViewportPlugin', { timeout: 20000 }, () => {
it('can set the viewport on puppeteer', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [chromeLauncher()],
plugins: [setViewportPlugin()],
});
});

it('can set the viewport on playwright', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [
playwrightLauncher({ product: 'chromium' }),
playwrightLauncher({ product: 'firefox' }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { describe, it } from 'node:test';
import path from 'path';
import { runTests } from '@web/test-runner-core/test-helpers';
import { playwrightLauncher } from '@web/test-runner-playwright';

import { snapshotPlugin } from '../../src/snapshotPlugin.js';

describe('snapshotPlugin', function test() {
this.timeout(20000);
import { snapshotPlugin } from '../../dist/snapshotPlugin.js';

describe('snapshotPlugin', { timeout: 20000 }, () => {
it('passes snapshot tests', async () => {
await runTests({
files: [path.join(__dirname, 'browser-test.js')],
files: [path.join(import.meta.dirname, 'browser-test.js')],
browsers: [
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'chromium' }),
Expand All @@ -19,7 +18,7 @@ describe('snapshotPlugin', function test() {
});

await runTests({
files: [path.join(__dirname, 'src', 'nested-test.js')],
files: [path.join(import.meta.dirname, 'src', 'nested-test.js')],
browsers: [
playwrightLauncher({ product: 'firefox' }),
playwrightLauncher({ product: 'chromium' }),
Expand Down
Loading