Skip to content

Conversation

Ashim-Stha
Copy link
Contributor

@Ashim-Stha Ashim-Stha commented Aug 20, 2025

Description

Rewrite the old Cucumber test from tests/e2e/cucumber/features/shares/internalLink.feature with a new Playwright test at tests/spec/internalLink.spec.ts

Related Issue

#12938

Run test

To run test locally in chromium in headed mode

NODE_TLS_REJECT_UNAUTHORIZED=0 npx playwright test -g "opening a link with internal role" --config=tests/e2e-playwright/ --project=chromium --headed

@Ashim-Stha Ashim-Stha self-assigned this Aug 20, 2025
@CLAassistant
Copy link

CLAassistant commented Aug 20, 2025

CLA assistant check
All committers have signed the CLA.

@Ashim-Stha Ashim-Stha force-pushed the replaceCucumberWithPlaywright branch 14 times, most recently from 1facfa0 to 9b2c634 Compare August 25, 2025 10:46
@Ashim-Stha Ashim-Stha marked this pull request as ready for review August 25, 2025 10:56
@saw-jan
Copy link
Member

saw-jan commented Aug 25, 2025

@Ashim-Stha Could you edit the PR title to something like this?
[POC][tests-only] e2e tests with Playwright only

@Ashim-Stha Ashim-Stha changed the title [tests-only][full-ci] Replace cucumber with playwright [POC][tests-only] e2e tests with Playwright only Aug 25, 2025
@Ashim-Stha
Copy link
Contributor Author

@Ashim-Stha Could you edit the PR title to something like this? [POC][tests-only] e2e tests with Playwright only

done 👍

@Ashim-Stha Ashim-Stha force-pushed the replaceCucumberWithPlaywright branch from 9b2c634 to c242bfc Compare August 25, 2025 11:43
@Ashim-Stha Ashim-Stha force-pushed the replaceCucumberWithPlaywright branch 2 times, most recently from 035965f to 69b0fc1 Compare August 29, 2025 11:25
@@ -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'
Copy link
Member

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?

Copy link
Contributor Author

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

@Ashim-Stha Ashim-Stha force-pushed the replaceCucumberWithPlaywright branch 5 times, most recently from aac2740 to 7a129ca Compare September 1, 2025 06:56
@Ashim-Stha Ashim-Stha force-pushed the replaceCucumberWithPlaywright branch 13 times, most recently from b702b0c to be31630 Compare September 2, 2025 05:41
@Ashim-Stha Ashim-Stha force-pushed the replaceCucumberWithPlaywright branch from be31630 to aaea273 Compare September 2, 2025 05:43
Copy link

sonarqubecloud bot commented Sep 2, 2025

@Ashim-Stha
Copy link
Contributor Author

can you run this on drone

done

Comment on lines +560 to +566
"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",
Copy link
Member

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.

Comment on lines +579 to +580
steps += tikaService() + \
ocisService()
Copy link
Member

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

Suggested change
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",
Copy link
Member

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

Suggested change
"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) => {
Copy link
Member

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) => {
Copy link
Member

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,
Copy link
Member

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

Suggested change
fullyParallel: true,
fullyParallel: false,

*/
export default defineConfig({
// Look for test files in the "tests" directory, relative to this configuration file.
testDir: 'spec',
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
testDir: 'spec',
testDir: 'specs',

}
}

export async function createFolderInPersonalSpaceUsingAPI(
Copy link
Member

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

Suggested change
export async function createFolderInPersonalSpaceUsingAPI(
export async function userHasCreatedFolder(

await api.dav.createFolderInsidePersonalSpace({ user, folder: folderName })
}

export async function shareResourceUsingAPI(
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
export async function shareResourceUsingAPI(
export async function userHasSharedResource(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants