Skip to content

Commit

Permalink
cannot install playwright lib #microsoft/playwright/issues/23228
Browse files Browse the repository at this point in the history
  • Loading branch information
danicc097 committed Jun 14, 2023
1 parent ec3673a commit d44aa60
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 39 deletions.
8 changes: 5 additions & 3 deletions bin/project
Original file line number Diff line number Diff line change
Expand Up @@ -1186,12 +1186,14 @@ x.e2e.run() {
{ { {
name="$PROJECT_PREFIX-e2e"
cd e2e
pnpm install -r --frozen-lockfile
pnpm i # cannot install playwright lib
DOCKER_BUILDKIT=1 BUILDKIT_PROGRESS=plain docker build -t "$name" .
cd - >/dev/null

# need symlink resolution
docker run -i --rm \
# need symlink resolution for data

test -0 && opts="-t"
docker run -i $opts --rm \
--ipc=host \
--network host \
-v "$(pwd)/cmd/oidc-server/data/:/cmd/oidc-server/data/" \
Expand Down
3 changes: 3 additions & 0 deletions e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ WORKDIR /e2e

ENV PATH /e2e/node_modules/.bin:$PATH




2 changes: 1 addition & 1 deletion e2e/__tests__/pages/login.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Page, BrowserContext } from '@playwright/test'
import type { Page, BrowserContext } from 'playwright'

export class LoginPage {
private readonly page: Page
Expand Down
13 changes: 13 additions & 0 deletions e2e/__tests__/specs/oidc-login.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import test, { expect } from '@playwright/test'
import { LoginPage } from '__tests__/pages/login'
import authServerUsers from '@users'

test('Login redirects to auth server and back if authenticated', async ({ page }) => {
test.skip() // TODO:
const loginPage = await LoginPage.create(page)
const user1 = authServerUsers.user1
await loginPage.enterCredentials(user1.username, user1.password)
await loginPage.submitLoginForm()

expect(page.url()).toBe('<expected_redirect_url>')
})
15 changes: 0 additions & 15 deletions e2e/__tests__/specs/oidc-login.test.ts

This file was deleted.

4 changes: 3 additions & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"keywords": [],
"author": "",
"devDependencies": {
"@playwright/test": "^1.35.0",
"typescript": "^4.8.2"
},
"dependencies": {
"@playwright/test": "^1.35.0"
}
}
22 changes: 11 additions & 11 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineConfig, devices } from "@playwright/test";
import { defineConfig, devices } from '@playwright/test'

/**
* Read environment variables from file.
Expand All @@ -10,7 +10,7 @@ import { defineConfig, devices } from "@playwright/test";
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: "./__tests__",
testDir: './__tests__',
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
Expand All @@ -20,31 +20,31 @@ export default defineConfig({
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
reporter: 'html',
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
// baseURL: 'http://127.0.0.1:3000',

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on-first-retry",
trace: 'on-first-retry',
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},

{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},

{
name: "webkit",
use: { ...devices["Desktop Safari"] },
name: 'webkit',
use: { ...devices['Desktop Safari'] },
},

/* Test against mobile viewports. */
Expand Down Expand Up @@ -74,4 +74,4 @@ export default defineConfig({
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
})
18 changes: 10 additions & 8 deletions e2e/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit d44aa60

Please sign in to comment.