From ae9618d8259de445cd406bce6dafacb564bbe3e6 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 26 Jun 2023 13:42:15 +0200 Subject: [PATCH] [test] Fix test:e2e local run (#37719) --- package.json | 4 ++-- test/README.md | 2 +- test/bundling/fixtures/create-react-app/package.json | 2 +- .../create-react-app/testCreateReactAppIntegration.js | 2 +- test/bundling/fixtures/esbuild/package.json | 2 +- test/bundling/fixtures/esbuild/testEsbuildIntegration.js | 2 +- .../fixtures/next-webpack4/testNextWebpack4Integration.js | 2 +- .../fixtures/next-webpack5/testNextWebpack5Integration.js | 2 +- test/bundling/fixtures/snowpack/package.json | 2 +- test/bundling/fixtures/snowpack/testSnowpackIntegration.js | 2 +- test/bundling/fixtures/vite/package.json | 2 +- test/bundling/fixtures/vite/testViteIntegration.js | 2 +- test/e2e/index.test.ts | 2 +- test/regressions/README.md | 2 +- test/regressions/index.test.js | 2 +- 15 files changed, 16 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index ac934bae0bf0ce..19a72d4d2fb63d 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/test/README.md b/test/README.md index edf763d555fba6..15e3e58a82e21e 100644 --- a/test/README.md +++ b/test/README.md @@ -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 diff --git a/test/bundling/fixtures/create-react-app/package.json b/test/bundling/fixtures/create-react-app/package.json index a34863cc3c0fba..0dfd28e22b6163 100644 --- a/test/bundling/fixtures/create-react-app/package.json +++ b/test/bundling/fixtures/create-react-app/package.json @@ -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", diff --git a/test/bundling/fixtures/create-react-app/testCreateReactAppIntegration.js b/test/bundling/fixtures/create-react-app/testCreateReactAppIntegration.js index e8cb1a55f26540..2142cdc2cd2230 100644 --- a/test/bundling/fixtures/create-react-app/testCreateReactAppIntegration.js +++ b/test/bundling/fixtures/create-react-app/testCreateReactAppIntegration.js @@ -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(); } diff --git a/test/bundling/fixtures/esbuild/package.json b/test/bundling/fixtures/esbuild/package.json index 2a473e9b8bd781..e5fe6cf7c413ac 100644 --- a/test/bundling/fixtures/esbuild/package.json +++ b/test/bundling/fixtures/esbuild/package.json @@ -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", diff --git a/test/bundling/fixtures/esbuild/testEsbuildIntegration.js b/test/bundling/fixtures/esbuild/testEsbuildIntegration.js index e8cb1a55f26540..2142cdc2cd2230 100644 --- a/test/bundling/fixtures/esbuild/testEsbuildIntegration.js +++ b/test/bundling/fixtures/esbuild/testEsbuildIntegration.js @@ -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(); } diff --git a/test/bundling/fixtures/next-webpack4/testNextWebpack4Integration.js b/test/bundling/fixtures/next-webpack4/testNextWebpack4Integration.js index 4b6a7a75a9a634..5f6fc1c70e3dba 100644 --- a/test/bundling/fixtures/next-webpack4/testNextWebpack4Integration.js +++ b/test/bundling/fixtures/next-webpack4/testNextWebpack4Integration.js @@ -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(); } diff --git a/test/bundling/fixtures/next-webpack5/testNextWebpack5Integration.js b/test/bundling/fixtures/next-webpack5/testNextWebpack5Integration.js index 4b6a7a75a9a634..5f6fc1c70e3dba 100644 --- a/test/bundling/fixtures/next-webpack5/testNextWebpack5Integration.js +++ b/test/bundling/fixtures/next-webpack5/testNextWebpack5Integration.js @@ -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(); } diff --git a/test/bundling/fixtures/snowpack/package.json b/test/bundling/fixtures/snowpack/package.json index 8de4df5e55316b..28cd40a553d98e 100644 --- a/test/bundling/fixtures/snowpack/package.json +++ b/test/bundling/fixtures/snowpack/package.json @@ -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", diff --git a/test/bundling/fixtures/snowpack/testSnowpackIntegration.js b/test/bundling/fixtures/snowpack/testSnowpackIntegration.js index dc37edbdd7e85a..32ef4ef36b0fa5 100644 --- a/test/bundling/fixtures/snowpack/testSnowpackIntegration.js +++ b/test/bundling/fixtures/snowpack/testSnowpackIntegration.js @@ -56,7 +56,7 @@ async function main() { ); } }); - await attemptGoto(page, 'http://localhost:3000/'); + await attemptGoto(page, 'http://localhost:5001/'); await browser.close(); } diff --git a/test/bundling/fixtures/vite/package.json b/test/bundling/fixtures/vite/package.json index 731a8ce1a2c46b..c7fe1c26df4858 100644 --- a/test/bundling/fixtures/vite/package.json +++ b/test/bundling/fixtures/vite/package.json @@ -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", diff --git a/test/bundling/fixtures/vite/testViteIntegration.js b/test/bundling/fixtures/vite/testViteIntegration.js index e8cb1a55f26540..2142cdc2cd2230 100644 --- a/test/bundling/fixtures/vite/testViteIntegration.js +++ b/test/bundling/fixtures/vite/testViteIntegration.js @@ -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(); } diff --git a/test/e2e/index.test.ts b/test/e2e/index.test.ts index b1a2fbf47e168b..a00a3cf5455fbd 100644 --- a/test/e2e/index.test.ts +++ b/test/e2e/index.test.ts @@ -61,7 +61,7 @@ async function attemptGoto(page: playwright.Page, url: string): Promise } describe('e2e', () => { - const baseUrl = 'http://localhost:3000'; + const baseUrl = 'http://localhost:5001'; let browser: playwright.Browser; let page: playwright.Page; const screen: PlaywrightScreen = { diff --git a/test/regressions/README.md b/test/regressions/README.md index 51829efcbf0470..850f7fa6ad42a7 100644 --- a/test/regressions/README.md +++ b/test/regressions/README.md @@ -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 diff --git a/test/regressions/index.test.js b/test/regressions/index.test.js index 1b8864f81fbb73..0b5f64b2c5f3f2 100644 --- a/test/regressions/index.test.js +++ b/test/regressions/index.test.js @@ -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({