-
-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49c5af9
commit 6ad9dd6
Showing
30 changed files
with
1,523 additions
and
1,347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module.exports = { | ||
webServer: { | ||
command: 'yarn start', | ||
port: 3000, | ||
timeout: 120 * 1000, | ||
reuseExistingServer: !process.env.CI, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {PlaywrightTestConfig} from '@playwright/test'; | ||
import defaultConfig from 'next-redux-wrapper-configs/playwright'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
...defaultConfig, | ||
webServer: { | ||
...defaultConfig.webServer, | ||
port: 4000, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,35 @@ | ||
import config from '../jest-puppeteer.config'; | ||
import {test, expect, Page} from '@playwright/test'; | ||
|
||
const openPage = (url = '/') => page.goto(`http://localhost:${config.server.port}${url}`); | ||
const openPage = (page: Page, url = '/') => page.goto(`http://localhost:4000${url}`); | ||
|
||
describe('Basic integration', () => { | ||
it('shows the page', async () => { | ||
await openPage(); | ||
test('shows the page', async ({page}) => { | ||
await openPage(page); | ||
|
||
await page.waitForSelector('div.index'); | ||
await page.waitForSelector('div.index'); | ||
|
||
await expect(page).toMatch('"page": "was set in index page /"'); | ||
await expect(page).toMatch('"custom": "custom"'); | ||
}); | ||
await expect(page.locator('body')).toContainText('"page": "was set in index page /"'); | ||
await expect(page.locator('body')).toContainText('"custom": "custom"'); | ||
}); | ||
|
||
it('clicks the button', async () => { | ||
await openPage('/other'); | ||
test('clicks the button', async ({page}) => { | ||
await openPage(page, '/other'); | ||
|
||
await page.waitForSelector('div.other'); | ||
await page.waitForSelector('div.other'); | ||
|
||
await expect(page).toMatch('"page": "was set in other page {}"'); | ||
await expect(page.locator('body')).toContainText('"page": "was set in other page {}"'); | ||
|
||
await expect(page).toClick('a', {text: 'Navigate to index'}); | ||
await page.click('text=Navigate to index'); | ||
|
||
await page.waitForSelector('div.index'); | ||
await page.waitForSelector('div.index'); | ||
|
||
await expect(page).toMatch('"page": "was set in index page'); | ||
await expect(page).toMatch('"custom": "custom"'); | ||
}); | ||
await expect(page.locator('body')).toContainText('"page": "was set in index page'); | ||
await expect(page.locator('body')).toContainText('"custom": "custom"'); | ||
}); | ||
|
||
it('initial page props', async () => { | ||
await openPage('/pageProps'); | ||
test('initial page props', async ({page}) => { | ||
await openPage(page, '/pageProps'); | ||
|
||
await page.waitForSelector('div.pageProps'); | ||
await page.waitForSelector('div.pageProps'); | ||
|
||
await expect(page).toMatch('{"prop":"foo"}'); | ||
}); | ||
await expect(page.locator('body')).toContainText('{"prop":"foo"}'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {PlaywrightTestConfig} from '@playwright/test'; | ||
import defaultConfig from 'next-redux-wrapper-configs/playwright'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
...defaultConfig, | ||
webServer: { | ||
...defaultConfig.webServer, | ||
port: 5050, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import config from '../jest-puppeteer.config'; | ||
import {test, expect, Page} from '@playwright/test'; | ||
|
||
const openPage = (url = '/') => page.goto(`http://localhost:${config.server.port}${url}`); | ||
const openPage = (page: Page, url = '/') => page.goto(`http://localhost:5050${url}`); | ||
|
||
describe('Basic integration', () => { | ||
it('shows the page', async () => { | ||
await openPage(); | ||
test('shows the page', async ({page}) => { | ||
await openPage(page); | ||
|
||
await page.waitForSelector('div.index'); | ||
await page.waitForSelector('div.index'); | ||
|
||
await expect(page).toMatch('"page": "async text"'); | ||
await expect(page).toMatch('"custom": "custom"'); | ||
}); | ||
await expect(page.locator('body')).toContainText('"page": "async text"'); | ||
await expect(page.locator('body')).toContainText('"custom": "custom"'); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {PlaywrightTestConfig} from '@playwright/test'; | ||
import defaultConfig from 'next-redux-wrapper-configs/playwright'; | ||
|
||
const config: PlaywrightTestConfig = { | ||
...defaultConfig, | ||
webServer: { | ||
...defaultConfig.webServer, | ||
port: 5000, | ||
}, | ||
}; | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,12 @@ | ||
import config from '../jest-puppeteer.config'; | ||
import {test, expect, Page} from '@playwright/test'; | ||
|
||
const openPage = (url = '/') => page.goto(`http://localhost:${config.server.port}${url}`); | ||
const openPage = (page: Page, url = '/') => page.goto(`http://localhost:5000${url}`); | ||
|
||
describe('Basic integration', () => { | ||
it('shows the page', async () => { | ||
await openPage(); | ||
test('shows the page', async ({page}) => { | ||
await openPage(page); | ||
|
||
await page.waitForSelector('div.index'); | ||
await page.waitForSelector('div.index'); | ||
|
||
await expect(page).toMatch('"page": "async text"'); | ||
await expect(page).toMatch('"custom": "custom"'); | ||
}); | ||
await expect(page.locator('body')).toContainText('"page": "async text"'); | ||
await expect(page.locator('body')).toContainText('"custom": "custom"'); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.