Skip to content

Commit

Permalink
[test] Fix test:e2e local run (mui#37719)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Jun 26, 2023
1 parent d24a3e7 commit ae9618d
Show file tree
Hide file tree
Showing 15 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"test:e2e:build": "webpack --config test/e2e/webpack.config.js",
"test:e2e:dev": "concurrently \"yarn test:e2e:build --watch\" \"yarn test:e2e:server\"",
"test:e2e:run": "mocha --config test/e2e/.mocharc.js 'test/e2e/**/*.test.{js,ts,tsx}'",
"test:e2e:server": "serve test/e2e",
"test:e2e:server": "serve test/e2e -p 5001",
"test:e2e-website": "playwright test test/e2e-website --config test/e2e-website/playwright.config.ts",
"test:e2e-website:dev": "cross-env PLAYWRIGHT_TEST_BASE_URL=http://localhost:3000 playwright test test/e2e-website --config test/e2e-website/playwright.config.ts",
"test:karma": "cross-env NODE_ENV=test karma start test/karma.conf.js",
Expand All @@ -62,7 +62,7 @@
"test:regressions:build": "webpack --config test/regressions/webpack.config.js",
"test:regressions:dev": "concurrently \"yarn test:regressions:build --watch\" \"yarn test:regressions:server\"",
"test:regressions:run": "mocha --config test/regressions/.mocharc.js --delay 'test/regressions/**/*.test.js'",
"test:regressions:server": "serve test/regressions",
"test:regressions:server": "serve test/regressions -p 5001",
"test:umd": "node packages/mui-material/test/umd/run.js",
"test:unit": "cross-env NODE_ENV=test mocha 'packages/**/*.test.{js,ts,tsx}' 'docs/**/*.test.{js,ts,tsx}' 'test/utils/**/*.test.{js,ts,tsx}'",
"test:argos": "node ./scripts/pushArgos.mjs",
Expand Down
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ You can pass the same arguments as you could to `mocha`.
For example, `yarn test:regressions:run --watch --grep "docs-system-basic"` to take new screenshots of every demo in `docs/src/pages/system/basic`.
You can view the screenshots in `test/regressions/screenshots/chrome`.

Alternatively, you might want to open `http://localhost:3000` (while `yarn test:regressions:dev` is running) to view individual views separately.
Alternatively, you might want to open `http://localhost:5001` (while `yarn test:regressions:dev` is running) to view individual views separately.

### Caveats

Expand Down
2 changes: 1 addition & 1 deletion test/bundling/fixtures/create-react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"scripts": {
"start": "yarn cross-env DISABLE_ESLINT_PLUGIN=true SKIP_PREFLIGHT_CHECK=true react-scripts build && concurrently --success first --kill-others \"yarn server\" \"node testCreateReactAppIntegration\"",
"server": "serve -s build"
"server": "serve -p 5001 -s build"
},
"dependencies": {
"@emotion/core": "11.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function main() {
`Expected no console messages but got ${consoleMessage.type()}: '${consoleMessage.text()}' `,
);
});
await attemptGoto(page, 'http://localhost:3000/');
await attemptGoto(page, 'http://localhost:5001/');

await browser.close();
}
Expand Down
2 changes: 1 addition & 1 deletion test/bundling/fixtures/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"start": "yarn build && concurrently --success first --kill-others \"yarn server\" \"node testEsbuildIntegration\"",
"build": "esbuild esbuild.fixture.js --bundle --outfile=build/esbuild.fixture.js",
"server": "serve -s build"
"server": "serve -p 5001 -s build"
},
"dependencies": {
"@emotion/core": "11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/bundling/fixtures/esbuild/testEsbuildIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function main() {
`Expected no console messages but got ${consoleMessage.type()}: '${consoleMessage.text()}' `,
);
});
await attemptGoto(page, 'http://localhost:3000/');
await attemptGoto(page, 'http://localhost:5001/');

await browser.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function main() {
`Expected no console messages but got ${consoleMessage.type()}: '${consoleMessage.text()}' `,
);
});
await attemptGoto(page, 'http://localhost:3000/next-webpack.fixture');
await attemptGoto(page, 'http://localhost:5001/next-webpack.fixture');

await browser.close();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function main() {
`Expected no console messages but got ${consoleMessage.type()}: '${consoleMessage.text()}' `,
);
});
await attemptGoto(page, 'http://localhost:3000/next-webpack.fixture');
await attemptGoto(page, 'http://localhost:5001/next-webpack.fixture');

await browser.close();
}
Expand Down
2 changes: 1 addition & 1 deletion test/bundling/fixtures/snowpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"scripts": {
"start": "yarn snowpack build && concurrently --success first --kill-others \"yarn server\" \"node testSnowpackIntegration\"",
"server": "serve -s build"
"server": "serve -p 5001 -s build"
},
"dependencies": {
"@emotion/core": "11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/bundling/fixtures/snowpack/testSnowpackIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ async function main() {
);
}
});
await attemptGoto(page, 'http://localhost:3000/');
await attemptGoto(page, 'http://localhost:5001/');

await browser.close();
}
Expand Down
2 changes: 1 addition & 1 deletion test/bundling/fixtures/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"license": "MIT",
"scripts": {
"start": "yarn vite build && concurrently --success first --kill-others \"yarn server\" \"node testViteIntegration\"",
"server": "serve -s build"
"server": "serve -p 5001 -s build"
},
"dependencies": {
"@emotion/core": "11.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/bundling/fixtures/vite/testViteIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function main() {
`Expected no console messages but got ${consoleMessage.type()}: '${consoleMessage.text()}' `,
);
});
await attemptGoto(page, 'http://localhost:3000/');
await attemptGoto(page, 'http://localhost:5001/');

await browser.close();
}
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ async function attemptGoto(page: playwright.Page, url: string): Promise<boolean>
}

describe('e2e', () => {
const baseUrl = 'http://localhost:3000';
const baseUrl = 'http://localhost:5001';
let browser: playwright.Browser;
let page: playwright.Page;
const screen: PlaywrightScreen = {
Expand Down
2 changes: 1 addition & 1 deletion test/regressions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you're adding a new test prefer a new component instead of editing existing f

`yarn test:regressions:dev` will build all fixtures and render an overview page that lists all fixtures.
This can be used to debug individual fixtures.
By default, a devtools-like view is shown that can be disabled by appending `#no-dev` to the URL e.g. `http://localhost:3000/docs-customization-typography/CustomResponsiveFontSizes#no-dev` or forced by appending `#dev` to the URL e.g. `http://localhost:3000/docs-customization-typography/CustomResponsiveFontSizes#dev`.
By default, a devtools-like view is shown that can be disabled by appending `#no-dev` to the URL e.g. `http://localhost:5001/docs-customization-typography/CustomResponsiveFontSizes#no-dev` or forced by appending `#dev` to the URL e.g. `http://localhost:5001/docs-customization-typography/CustomResponsiveFontSizes#dev`.

### Automatic

Expand Down
2 changes: 1 addition & 1 deletion test/regressions/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as path from 'path';
import * as playwright from 'playwright';

async function main() {
const baseUrl = 'http://localhost:3000';
const baseUrl = 'http://localhost:5001';
const screenshotDir = path.resolve(__dirname, './screenshots/chrome');

const browser = await playwright.chromium.launch({
Expand Down

0 comments on commit ae9618d

Please sign in to comment.