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

Updated setup instructions #1

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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.

Copy link
Member Author

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.

ddev start
ddev composer create drupal/recommended-project:^10
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And if we drop ^10 it will just use the latest stable?

ddev composer require drush/drush
ddev get deviantintegral/ddev-playwright
ddev restart
```

### Initialize Playwright Tests
Expand Down Expand Up @@ -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"]
}
},
Expand All @@ -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,
}
})
Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this failing?

Copy link
Member Author

Choose a reason for hiding this comment

The 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);
});
Expand Down Expand Up @@ -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:

Expand Down