-
Notifications
You must be signed in to change notification settings - Fork 1
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
Updated setup instructions #1
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,12 +61,14 @@ Integrating this library into a site takes several steps. For the sake of comple | |
### Create the Drupal Site and Initialize DDEV | ||
|
||
```console | ||
composer create-project drupal/recommended-project pwtest | ||
composer require drush/drush | ||
mkdir pwtest | ||
cd pwtest | ||
ddev config --project-type drupal10 | ||
ddev get deviantintegral/ddev-playwright | ||
ddev config --project-type=drupal --php-version=8.3 --docroot=web | ||
ddev start | ||
ddev composer create drupal/recommended-project:^10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And if we drop |
||
ddev composer require drush/drush | ||
ddev get deviantintegral/ddev-playwright | ||
ddev restart | ||
``` | ||
|
||
### Initialize Playwright Tests | ||
|
@@ -113,8 +115,8 @@ Set the following in `test/playwright/tsconfig.json`, merging with any existing | |
"noEmit": true, | ||
"baseUrl": ".", | ||
"paths": { | ||
"~": ["./src"], | ||
"~*": ["./src/*"], | ||
"~": ["./tests"], | ||
"~*": ["./tests/*"], | ||
"@packages/playwright-drupal": ["./packages/playwright-drupal"] | ||
} | ||
}, | ||
|
@@ -128,8 +130,8 @@ Add the following `globalSetup` and `use` line to the `defineConfig` section in | |
```typescript | ||
export default defineConfig({ | ||
globalSetup: require.resolve('./node_modules/playwright-drupal/lib/setup/global-setup'), | ||
baseURL: process.env.DDEV_PRIMARY_URL, | ||
use: { | ||
baseURL: process.env.DDEV_PRIMARY_URL, | ||
ignoreHTTPSErrors: true, | ||
} | ||
}) | ||
|
@@ -196,8 +198,6 @@ test('proves parallel tests work', async ({ page }) => { | |
await page.getByLabel('Title', { exact: true }).fill(randomTitle); | ||
await page.getByRole('button', { name: 'Save' }).click(); | ||
|
||
await expect(page.url()).toMatch('node/1') | ||
|
||
Comment on lines
-199
to
-200
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this failing? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I was testing this with umami. |
||
await expect(page).toHaveTitle(`${randomTitle} | Playwright`); | ||
await expect(page.locator('h1')).toHaveText(randomTitle); | ||
}); | ||
|
@@ -360,7 +360,7 @@ import {config} from '~/visualdiff-urls'; | |
config.describe(); | ||
``` | ||
|
||
3. Update the Playwright configuration to skip these tests in normal functional tests, and skip normal functional tests when running these tests. | ||
3. Update the Playwright configuration at `playwright.config.ts` to skip these tests in normal functional tests, and skip normal functional tests when running these tests. | ||
|
||
For all existing tests, add `testIgnore` like so: | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should omit the PHP version, so we don't have to change this as time goes on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If people have a recent ddev version should be ok omitting it.