Skip to content

Commit

Permalink
Convert to a local test with phpinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
deviantintegral committed May 3, 2023
1 parent d17aa5e commit 7a2dc0f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
10 changes: 4 additions & 6 deletions tests/test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ get_addon() {
}

verify_run_playwright() {
cp -av "$DIR"/tests/testdata/web/ web/
cp "$DIR"/tests/testdata/phpinfo.spec.ts test/playwright/tests/phpinfo.spec.ts
ddev install-playwright
health_checks

Expand All @@ -88,12 +90,8 @@ verify_run_playwright() {
# Playwright currently supports 4 browsers.
assert_output 4

# Verify we can run the example test.
# This uses the literal Playwright example, so it is dependent on network
# access. However, so is the earlier npm install commands and downloading
# browsers, so we may as well do the simple out-of-the-box solution.
# ddev exec -- ls -la /mnt/ddev_config/commands/web/
ddev playwright test
# Verify we can run an example test.
ddev playwright test --reporter=line
}

@test "install from directory with npm" {
Expand Down
6 changes: 6 additions & 0 deletions tests/testdata/phpinfo.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { test, expect } from '@playwright/test';

test('has title', async ({ page }) => {
await page.goto(process.env.DDEV_PRIMARY_URL);
await expect(page).toHaveTitle(/phpinfo/);
});
3 changes: 3 additions & 0 deletions tests/testdata/web/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

phpinfo();

0 comments on commit 7a2dc0f

Please sign in to comment.