Skip to content

Commit

Permalink
Playwright E2E tests clean-up. Remove all references to Cypress. (#346)
Browse files Browse the repository at this point in the history
Following up on #335 and issue #330 - this removes all references to Cypress. Apps incorporating these changes will need to update their environment variables and repository secrets accordingly.
  • Loading branch information
whusterj authored Aug 28, 2024
1 parent e145468 commit 0d0801f
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
env:
NPM_CONFIG_PRODUCTION: false
PLAYWRIGHT_TEST_BASE_URL: ${{ github.event.deployment_status.environment_url }}
CYPRESS_TEST_USER_PASS: ${{ secrets.CYPRESS_TEST_USER_PASS }}
PLAYWRIGHT_TEST_USER_PASS: ${{ secrets.PLAYWRIGHT_TEST_USER_PASS }}
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
env:
PLAYWRIGHT_TEST_BASE_URL:
{{ "${{ github.event.deployment_status.environment_url }}" }}
CYPRESS_TEST_USER_PASS:
{{ "${{ secrets.CYPRESS_TEST_USER_PASS }}" }}
PLAYWRIGHT_TEST_USER_PASS:
{{ "${{ secrets.PLAYWRIGHT_TEST_USER_PASS }}" }}
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"DJANGO_SUPERUSER_PASSWORD": {
"value": "!!!DJANGO_SECRET_KEY!!!"
},
"CYPRESS_TEST_USER_PASS": {
"PLAYWRIGHT_TEST_USER_PASS": {
"value": "!!!DJANGO_SECRET_KEY!!!"
},
"SECRET_KEY": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { test, expect } from '@playwright/test'
import dotenv from 'dotenv'

test('Login workflow', async ({ page }) => {
expect(process.env.CYPRESS_TEST_USER_PASS).toBeTruthy()
expect(process.env.PLAYWRIGHT_TEST_USER_PASS).toBeTruthy()

await page.goto('/log-in')
await page.getByTestId('email').fill('[email protected]')
await page.getByTestId('password').fill(process.env.CYPRESS_TEST_USER_PASS ?? '')
await page.getByTestId('password').fill(process.env.PLAYWRIGHT_TEST_USER_PASS ?? '')
await page.getByTestId('submit').click()

await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { test, expect } from '@playwright/test'

test('Login workflow', async ({ page }) => {
expect(process.env.CYPRESS_TEST_USER_PASS).toBeTruthy()
expect(process.env.PLAYWRIGHT_TEST_USER_PASS).toBeTruthy()

await page.goto('/login')
await page.getByPlaceholder('Enter email...').fill('[email protected]')
await page.getByPlaceholder('Enter password...').fill(process.env.CYPRESS_TEST_USER_PASS ?? '')
await page.getByPlaceholder('Enter password...').fill(process.env.PLAYWRIGHT_TEST_USER_PASS ?? '')
await page.getByRole('button', { name: 'Log in' }).click()

await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible()
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_slug}}/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"cacheDirectories": [
"client/node_modules",
".cache/Cypress"
".cache/ms-playwright"
],
"dependencies": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Command(BaseCommand):
def handle(self, *args, **kwargs):
logger.info(f"Starting management command {__name__}")
superuser_password = config("DJANGO_SUPERUSER_PASSWORD")
playwright_password = config("CYPRESS_TEST_USER_PASS")
playwright_password = config("PLAYWRIGHT_TEST_USER_PASS")
get_user_model().objects.create_superuser(
email="[email protected]", password=superuser_password, first_name="Admin", last_name="ThinkNimble"
)
Expand Down

0 comments on commit 0d0801f

Please sign in to comment.