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: GraphiQL IDE test failures #3079

Merged
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ced177e
- replace workflows for GraphiQL e2e and unit tests with the .yml fil…
jasonbahl Mar 25, 2024
21166d2
- replace all dev-dependencies (other than the remark ones) with the …
jasonbahl Mar 25, 2024
502e10d
- remove way outdated .nvmrc
jasonbahl Mar 26, 2024
de14dbc
- update package.json scripts
jasonbahl Mar 26, 2024
31a7881
- remove unused .prettierignore, .prettierrc.json and babel.config.js
jasonbahl Mar 26, 2024
e45edc1
- re-build app using updated `build` command (using latest version of…
jasonbahl Mar 26, 2024
18428a0
- update package versions
jasonbahl Mar 26, 2024
e603456
- remove ant css import
jasonbahl Mar 26, 2024
350da60
- rebuild assets
jasonbahl Mar 26, 2024
c6cce61
- remove unit tests (gonna roll with e2e for now as we rebuild the co…
jasonbahl Mar 26, 2024
62a5abb
- convert tests from puppeteer to playwright
jasonbahl Mar 26, 2024
4d944f4
- update workflow to run on develop/master and only when JS files change
jasonbahl Mar 26, 2024
7e2818c
- update selector
jasonbahl Mar 26, 2024
45c51ec
- update workflow to upload screenshots on failure
jasonbahl Mar 26, 2024
553632c
- yml formatting
jasonbahl Mar 26, 2024
f6db83b
- updade workflow to list contents of the artifacts directory
jasonbahl Mar 26, 2024
d96d8f6
- another attempt at uploading the screenshots
jasonbahl Mar 27, 2024
83697c1
- update action to v4
jasonbahl Mar 27, 2024
e55ca53
- wait for networkidle
jasonbahl Mar 27, 2024
abb2983
- update loadGraphiql function
jasonbahl Mar 27, 2024
3f3fc64
- force the login to go to wp-login.php
jasonbahl Mar 27, 2024
5c3ff24
- add some debugging
jasonbahl Mar 27, 2024
0e0cb7a
- more debugging
jasonbahl Mar 27, 2024
81fb171
- more debugging
jasonbahl Mar 27, 2024
83abbd7
- more debugging
jasonbahl Mar 27, 2024
af6b9f3
- more debugging
jasonbahl Mar 27, 2024
4284a9f
- upload entire playwright artifacts
jasonbahl Mar 27, 2024
2af5318
- moving the test to one file and further debugging
jasonbahl Mar 27, 2024
01dca1b
- add composer install step to the workflow
jasonbahl Mar 27, 2024
1e679b1
yml formatting
jasonbahl Mar 27, 2024
b28c9e2
- revert test files to a state before I went mad debugging
jasonbahl Mar 27, 2024
8ee91e4
- remove debugging steps from Workflow
jasonbahl Mar 27, 2024
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
103 changes: 54 additions & 49 deletions .github/workflows/graphiql-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,59 @@
name: GraphiQL End-to-End Tests

on:
workflow_dispatch:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
paths:
- '**.js'
- '.github/workflows/*.yml'
- '!docs/**'

jobs:
admin:
name: GraphiQL E2E Tests
runs-on: ubuntu-latest
if: ${{ github.repository == 'wp-graphql/wp-graphql' || github.event_name == 'pull_request' }}
strategy:
fail-fast: false
matrix:
node: ['16.13.0']

steps:
- name: Cancel previous runs of this workflow (pull requests only)
if: ${{ github.event_name == 'pull_request' }}
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- name: Checkout
uses: actions/checkout@v3

- name: Use desired version of NodeJS
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm

- name: Setup PHP w/ Composer & WP-CLI
uses: shivammathur/setup-php@v2
with:
php-version: 7.3
extensions: mbstring, intl, bcmath, exif, gd, mysqli, opcache, zip, pdo_mysql
coverage: none
tools: composer, wp-cli

- name: Install Composer Dependencies
run: |
composer install --no-dev

- name: Install NPM Dependencies and Build the GraphiQL App
id: install-and-build
run: |
npm ci && npm run build

- name: Install WordPress
run: |
npm run wp-env start
- name: Running the tests
run: |
npm run test-e2e
e2e-tests:
name: E2E tests on Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['18']
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Build Assets
run: npm run build

- name: Install Playwright dependencies
run: |
npx playwright install chromium firefox webkit --with-deps

- name: Start WordPress Environment
run: npm run wp-env -- start

- name: Run E2E tests
run: npm run test:e2e
continue-on-error: true # This allows the workflow to continue even if this step fails, so that screenshots can be collected.

- name: Upload Screenshots on Failure
if: failure() # This ensures that the following steps are only run if the previous step fails.
uses: actions/upload-artifact@v2
with:
name: failed-test-screenshots
path: artifacts/test-results/

- name: Stop WordPress Environment
run: npm run wp-env -- stop

54 changes: 0 additions & 54 deletions .github/workflows/graphiql-unit-tests.yml

This file was deleted.

1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

1 change: 0 additions & 1 deletion .prettierrc.json

This file was deleted.

21 changes: 0 additions & 21 deletions .remarkrc

This file was deleted.

9 changes: 9 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"core": "WordPress/WordPress",
"plugins": [ "." ],
"themes": [],
"port": 8888,
"config": {
"WP_DEBUG": true
}
}
8 changes: 0 additions & 8 deletions babel.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion build/app.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-dom', 'wp-element', 'wp-hooks'), 'version' => 'e4db36ac3a701438f12c');
<?php return array('dependencies' => array('react', 'react-dom', 'wp-element', 'wp-hooks'), 'version' => '878a79f97bdc86d6e199');