Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix e2e tests #13027

Merged
merged 24 commits into from
Mar 14, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/tests-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ jobs:
- name: Install libgbm1
run: sudo apt-get install libgbm1

- name: Setup Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install dependencies
run: npm install puppeteer
env:
Expand Down Expand Up @@ -215,7 +221,7 @@ jobs:
if: ( matrix.snapshots ) && ( github.event.pull_request.draft == false )

- name: Run E2E tests
run: npm run test:e2e -- --shard=$SHARD
run: npm run test:e2e packages/e2e-tests/src/specs/editor/storyDetailsModal/adminUser.js
swissspidy marked this conversation as resolved.
Show resolved Hide resolved
env:
WP_VERSION: ${{ matrix.wp }}
SHARD: ${{ matrix.shard }}
Expand Down
95 changes: 66 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"postcss-jsx": "^0.36.4",
"postcss-syntax": "^0.36.2",
"prettier": "^2.8.4",
"puppeteer": "^19.6.3",
"puppeteer": "^19.7.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-refresh": "^0.14.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/src/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default {
rootDir: '../../../',
resolver: '@web-stories-wp/jest-resolver',
preset: '<rootDir>/packages/e2e-tests/node_modules/jest-puppeteer',
// testEnvironment: '<rootDir>/packages/e2e-tests/src/puppeteerEnvironment.js',
testEnvironment: '<rootDir>/packages/e2e-tests/src/puppeteerEnvironment.js',
testMatch: ['**/specs/**/*.[jt]s'],
testPathIgnorePatterns: [
'<rootDir>/.git',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,7 @@ describe('Story Details Modal - Admin User', () => {
await expect(authorDropDownButton).toMatch('author');
});

// As if here it's using Jest's original toMatch() matcher instead of
// the one from jest-puppeteer.
//
// expect(received).toMatch(expected)
//
// Matcher error: received value must be a string
//
// Received has type: object
// Received has value: {}
//
// eslint-disable-next-line jest/no-disabled-tests -- TODO: Fix flakey test.
it.skip('should allow searching author', async () => {
it('should allow searching author', async () => {
await openPublishingPanel();

const authorDropDownButton = await expect(page).toMatchElement(
Expand Down