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): migrate from cypress to playwright & fix sandpackStateFromProps #593

Merged
merged 17 commits into from
Sep 30, 2022
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"packages": ["sandpack-client", "sandpack-react"],
"sandboxes": ["sowx8r", "p9l5gn"],
"sandboxes": ["sowx8r"],
"node": "14"
}
3 changes: 1 addition & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@ dist/
esm/
sandpack/
file-resolver-protocol.ts
examples/
cypress/
examples/
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
// TypeScript specific rules
"plugin:@typescript-eslint/recommended",
// Disable eslint rules that conflict with Prettier's formatting
"prettier",
"plugin:cypress/recommended"
"prettier"
],
"parser": "@typescript-eslint/parser",
"rules": {
Expand Down
64 changes: 12 additions & 52 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,57 +92,10 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

chromatic-deployment:
name: Chromatic deployment
runs-on: ubuntu-latest
timeout-minutes: 10
needs: install
steps:
- name: Setup | Checkout
uses: actions/checkout@v1

- name: Setup | Node.js
uses: actions/setup-node@v2
with:
node-version-file: .nvmrc

- name: Setup | Cache node_modules
uses: actions/cache@v3
with:
path: |
node_modules
packages/*/node_modules
key: modules-${{ hashFiles('yarn.lock') }}

- name: Setup | Restore react build
uses: actions/download-artifact@v2
with:
name: sandpack-react-${{ github.sha }}
path: sandpack-react/dist

- name: Setup | Restore client build
uses: actions/download-artifact@v2
with:
name: sandpack-client-${{ github.sha }}
path: sandpack-client/dist

- name: Setup | Restore theme build
uses: actions/download-artifact@v2
with:
name: sandpack-themes-${{ github.sha }}
path: sandpack-themes/dist

- name: Publish to Chromatic
uses: chromaui/action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
buildScriptName: "chromatic:react"

integration:
name: Integration tests
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 20
needs: install
steps:
- name: Setup | Checkout
Expand Down Expand Up @@ -179,11 +132,18 @@ jobs:
name: sandpack-themes-${{ github.sha }}
path: sandpack-themes/dist

- name: Cypress run
uses: cypress-io/github-action@v2
- name: Install Playwright Browsers
run: npx playwright install --with-deps

- name: Run Playwright tests
run: cd sandpack-react && npx playwright test

- uses: actions/upload-artifact@v2
if: always()
with:
start: yarn dev:react
config: video=false
name: playwright-report
path: sandpack-react/playwright-report/
retention-days: 30

test:
name: Unit tests
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,3 @@ dist

# Mac
.DS_Store

cypress/videos
cypress/screenshots
6 changes: 0 additions & 6 deletions cypress.json

This file was deleted.

5 changes: 0 additions & 5 deletions cypress/fixtures/example.json

This file was deleted.

53 changes: 0 additions & 53 deletions cypress/integration/CodeMirror.spec.js

This file was deleted.

23 changes: 0 additions & 23 deletions cypress/integration/CodeViewer.spec.js

This file was deleted.

20 changes: 0 additions & 20 deletions cypress/integration/Issues.spec.js

This file was deleted.

24 changes: 0 additions & 24 deletions cypress/integration/Sandpack.spec.js

This file was deleted.

31 changes: 0 additions & 31 deletions cypress/integration/Templates.spec.js

This file was deleted.

22 changes: 0 additions & 22 deletions cypress/plugins/index.js

This file was deleted.

Loading