-
Notifications
You must be signed in to change notification settings - Fork 186
[POC][tests-only] e2e tests with Playwright only #12941
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
base: master
Are you sure you want to change the base?
Conversation
1facfa0
to
9b2c634
Compare
@Ashim-Stha Could you edit the PR title to something like this? |
done 👍 |
9b2c634
to
c242bfc
Compare
035965f
to
69b0fc1
Compare
@@ -3,7 +3,7 @@ import { User } from '../../types' | |||
import join from 'join-path' | |||
import { getSpaceIdBySpaceName } from '../graph' | |||
import convert from 'xml-js' | |||
import _ from 'lodash-es/object' | |||
import _ from 'lodash-es/object.js' |
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.
why do we need this change?
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.
we get this error when running playwright test
Error: Cannot find module '/var/www/owncloud/web/tests/e2e/node_modules/lodash-es/object' imported from /var/www/owncloud/web/tests/e2e/support/api/davSpaces/spaces.ts
Did you mean to import "lodash-es/object.js"?
Error: No tests found
aac2740
to
7a129ca
Compare
b702b0c
to
be31630
Compare
Signed-off-by: Ashim Shrestha <[email protected]>
be31630
to
aaea273
Compare
|
done |
"HEADLESS": "true", | ||
"RETRY": "1", | ||
"BASE_URL_OCIS": "ocis:9200", | ||
"FAIL_ON_UNCAUGHT_CONSOLE_ERR": "true", | ||
"PLAYWRIGHT_BROWSERS_PATH": ".playwright", | ||
"BROWSER": "chromium", | ||
"FEDERATED_BASE_URL_OCIS": "federation-ocis:9200", |
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.
most of these are not in use. need to update playwright accordingly.
steps += tikaService() + \ | ||
ocisService() |
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.
we should add tika once the search e2e tests are added
steps += tikaService() + \ | |
ocisService() | |
steps += ocisService() |
@@ -12,6 +12,7 @@ | |||
"lint": "eslint vite.config.ts '{packages,tests}/**/*.{js,ts,vue}' --color", | |||
"serve": "SERVER=true pnpm build:w", | |||
"test:e2e:cucumber": "NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e -f json:tests/e2e/cucumber/report/cucumber_report.json", | |||
"test:e2e:playwright": "NODE_TLS_REJECT_UNAUTHORIZED=0 npx playwright test --config=tests/e2e-playwright/ --project=chromium", |
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.
we should provide project while running the test: pnpm test:e2e:playwright -- --project=chromium
"test:e2e:playwright": "NODE_TLS_REJECT_UNAUTHORIZED=0 npx playwright test --config=tests/e2e-playwright/ --project=chromium", | |
"test:e2e:playwright": "NODE_TLS_REJECT_UNAUTHORIZED=0 npx playwright test --config=tests/e2e-playwright/", |
import { api, environment, store } from '../../e2e/support' | ||
import { User, UserState } from '../../e2e/support/types' | ||
|
||
const cleanupPredefinedUser = async (userKey: string, user: User) => { |
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.
let's omit dealing with predefined users in this PR
import { User } from '../../e2e/support/types' | ||
import { UsersEnvironment } from '../../e2e/support/environment' | ||
|
||
const storeKeycloakGroups = async (adminUser: User, usersEnvironment) => { |
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.
same as above, let's omit dealing with keycloak in this PR
testDir: 'spec', | ||
|
||
// Run all tests in parallel. | ||
fullyParallel: true, |
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.
we cannot run tests in parallel
fullyParallel: true, | |
fullyParallel: false, |
*/ | ||
export default defineConfig({ | ||
// Look for test files in the "tests" directory, relative to this configuration file. | ||
testDir: 'spec', |
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.
testDir: 'spec', | |
testDir: 'specs', |
} | ||
} | ||
|
||
export async function createFolderInPersonalSpaceUsingAPI( |
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.
it's better to follow same naming for all the step methods
export async function createFolderInPersonalSpaceUsingAPI( | |
export async function userHasCreatedFolder( |
await api.dav.createFolderInsidePersonalSpace({ user, folder: folderName }) | ||
} | ||
|
||
export async function shareResourceUsingAPI( |
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.
export async function shareResourceUsingAPI( | |
export async function userHasSharedResource( |
Description
Rewrite the old Cucumber test from
tests/e2e/cucumber/features/shares/internalLink.feature
with a new Playwright test attests/spec/internalLink.spec.ts
Related Issue
#12938
Run test
To run test locally in
chromium
inheaded
mode