Skip to content
Draft
Show file tree
Hide file tree
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
133 changes: 128 additions & 5 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ config = {
"master",
"stable-*",
],
"pnpmlint": True,
"pnpmlint": False,
"e2e": {
"a11y": {
"earlyFail": True,
Expand Down Expand Up @@ -290,7 +290,7 @@ def beforePipelines(ctx):
pipelinesDependsOn(pnpmlint(ctx), pnpmCache(ctx))

def stagePipelines(ctx):
unit_test_pipelines = unitTests(ctx)
unit_test_pipelines = [] #unitTests(ctx)

# run only unit tests when publishing a standalone package
if (determineReleasePackage(ctx) != None):
Expand Down Expand Up @@ -589,7 +589,7 @@ def e2eTestsOnPlaywright(ctx):
"federationServer": False,
"failOnUncaughtConsoleError": False,
"extraServerEnvironment": {},
"skipA11y": True,
"skipA11y": False,
"reportTracing": False,
}

Expand Down Expand Up @@ -724,7 +724,7 @@ def e2eTests(ctx):
"federationServer": False,
"failOnUncaughtConsoleError": False,
"extraServerEnvironment": {},
"skipA11y": True,
"skipA11y": False,
}

pipelines = []
Expand Down Expand Up @@ -826,6 +826,7 @@ def e2eTests(ctx):
"bash run-e2e.sh",
],
}] + \
logAccessibilityReport() + \
uploadTracingResult(ctx) + \
logTracingResult(ctx)

Expand Down Expand Up @@ -914,7 +915,7 @@ def lint():
"name": "lint",
"image": OC_CI_NODEJS_IMAGE,
"commands": [
"pnpm lint",
# "pnpm lint",
],
}]

Expand Down Expand Up @@ -1771,6 +1772,18 @@ def logTracingResult(ctx, e2e_type = "cucumber"):
},
}]

def logAccessibilityReport():
return [{
"name": "log-accessibility-report",
"image": OC_UBUNTU_IMAGE,
"commands": [
"cat %s/a11y-report-cucumber.json" % dir["web"],
],
"when": {
"status": ["failure", "success"],
},
}]

def waitForServices(name, services = []):
services = ",".join(services)
return [{
Expand Down Expand Up @@ -1927,6 +1940,116 @@ def keycloakService():
],
}] + waitForServices("keycloak", ["keycloak:8443"])

def e2eTestsOnKeycloak(ctx):
e2e_Keycloak_tests = [
"journeys",
"admin-settings/users.feature:20",
"admin-settings/users.feature:43",
"admin-settings/users.feature:106",
"admin-settings/users.feature:131",
"admin-settings/users.feature:185",
"admin-settings/spaces.feature",
"admin-settings/groups.feature",
"admin-settings/general.feature",
"keycloak",
]

e2e_volumes = [
{
"name": "uploads",
"temp": {},
},
{
"name": "configs",
"temp": {},
},
{
"name": "gopath",
"temp": {},
},
{
"name": "ocis-config",
"temp": {},
},
{
"name": "certs",
"temp": {},
},
]

steps = []
if not "full-ci" in ctx.build.title.lower() and ctx.build.event != "cron":
steps += skipIfUnchanged(ctx, "drone-ci")

steps += restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") + \
installPnpm() + \
restoreBrowsersCache() + \
keycloakService() + \
restoreBuildArtifactCache(ctx, "web-dist", "dist")
if ctx.build.event == "cron":
steps += restoreBuildArtifactCache(ctx, "ocis", "ocis")
else:
steps += restoreOcisCache()

# configs to setup ocis with keycloak
environment = {
"PROXY_AUTOPROVISION_ACCOUNTS": "true",
"PROXY_ROLE_ASSIGNMENT_DRIVER": "oidc",
"OCIS_OIDC_ISSUER": "https://keycloak:8443/realms/oCIS",
"PROXY_OIDC_REWRITE_WELLKNOWN": "true",
"WEB_OIDC_CLIENT_ID": "web",
"PROXY_USER_OIDC_CLAIM": "preferred_username",
"PROXY_USER_CS3_CLAIM": "username",
"OCIS_ADMIN_USER_ID": "",
"OCIS_EXCLUDE_RUN_SERVICES": "idp",
"GRAPH_ASSIGN_DEFAULT_USER_ROLE": "false",
"GRAPH_USERNAME_MATCH": "none",
"KEYCLOAK_DOMAIN": "keycloak:8443",
}

steps += ocisService(environment) + \
[
{
"name": "e2e-tests",
"image": OC_CI_NODEJS_IMAGE,
"environment": {
"BASE_URL_OCIS": "ocis:9200",
"HEADLESS": "true",
"RETRY": "1",
"REPORT_TRACING": "with-tracing" in ctx.build.title.lower(),
"KEYCLOAK": "true",
"KEYCLOAK_HOST": "keycloak:8443",
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
"BROWSER": "chromium",
},
"commands": [
"cd tests/e2e",
"bash run-e2e.sh %s" % " ".join(["cucumber/features/" + tests for tests in e2e_Keycloak_tests]),
],
},
] + \
logAccessibilityReport() + \
uploadTracingResult(ctx) + \
logTracingResult(ctx, "e2e-tests keycloak-journey-suite")

return [{
"kind": "pipeline",
"type": "docker",
"name": "e2e-test-on-keycloak",
"workspace": web_workspace,
"steps": steps,
"services": postgresService(),
"volumes": e2e_volumes,
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/stable-*",
"refs/tags/**",
"refs/pull/**",
],
},
}]

def getOcislatestCommitId(ctx):
web_repo_path = "https://raw.githubusercontent.com/owncloud/web/%s" % ctx.build.commit
return [
Expand Down
7 changes: 5 additions & 2 deletions tests/e2e-playwright/steps/ui/account.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { World } from '../../../e2e/cucumber/environment'
import { objects } from '../../../e2e/support'
import { ActorsEnvironment } from '../../../e2e/support/environment'

Expand Down Expand Up @@ -30,14 +31,16 @@ export async function changeLanguage({

export async function getAccountPageTitle({
actorsEnvironment,
stepUser
stepUser,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
world?: World
}): Promise<string> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const accountObject = new objects.account.Account({ page })
return await accountObject.getTitle()
return await accountObject.getTitle(world)
}

export async function requestGdprExport({
Expand Down
7 changes: 5 additions & 2 deletions tests/e2e-playwright/steps/ui/adminSettings.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import { World } from '../../../e2e/cucumber/environment'
import { objects } from '../../../e2e/support'
import { ActorsEnvironment, FilesEnvironment } from '../../../e2e/support/environment'

export async function navigateToGeneralManagementPage({
actorsEnvironment,
stepUser
stepUser,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
world?: World
}): Promise<void> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.applicationAdminSettings.page.General({ page })
await pageObject.navigate()
await pageObject.navigate(world)
}

export async function uploadLogoFromLocalPath({
Expand Down
49 changes: 33 additions & 16 deletions tests/e2e-playwright/steps/ui/appStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ActorsEnvironment } from '../../../e2e/support/environment/index.js'
import { objects } from '../../../e2e/support'
import { Download } from '@playwright/test'
import { World } from '../../../e2e/cucumber/environment'

export async function openAppStore({
actorsEnvironment,
Expand Down Expand Up @@ -42,109 +43,125 @@ export async function selectApp({
export async function waitForAppDetailsIsVisible({
actorsEnvironment,
stepUser,
app
app,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
app: string
world?: World
}): Promise<void> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.appStore.AppStore({ page })
await pageObject.waitForAppDetailsIsVisible(app)
await pageObject.waitForAppDetailsIsVisible(app, world)
}

export async function downloadAppVersion({
actorsEnvironment,
stepUser,
version
version,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
version: string
world?: World
}): Promise<string> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.appStore.AppStore({ page })
return await pageObject.downloadAppVersion(version)
return await pageObject.downloadAppVersion(version, world)
}

export async function downloadApp({
actorsEnvironment,
stepUser,
app
app,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
app: string
world?: World
}): Promise<Download> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.appStore.AppStore({ page })
return await pageObject.downloadApp(app)
return await pageObject.downloadApp(app, world)
}

export async function navigateToAppStoreOverview({
actorsEnvironment,
stepUser
stepUser,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
world?: World
}): Promise<void> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.appStore.AppStore({ page })
await pageObject.navigateToAppStoreOverview()
await pageObject.navigateToAppStoreOverview(world)
}

export async function getAppsList({
actorsEnvironment,
stepUser
stepUser,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
world?: World
}): Promise<Array<string>> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.appStore.AppStore({ page })
return await pageObject.getAppsList()
return await pageObject.getAppsList(world)
}

export async function setSearchTerm({
actorsEnvironment,
stepUser,
searchTerm
searchTerm,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
searchTerm: string
world?: World
}): Promise<void> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.appStore.AppStore({ page })
await pageObject.setSearchTerm(searchTerm)
await pageObject.setSearchTerm(searchTerm, world)
}

export async function selectAppTag({
actorsEnvironment,
stepUser,
tag,
app
app,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
tag: string
app: string
world?: World
}): Promise<void> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.appStore.AppStore({ page })
await pageObject.selectAppTag({ tag, app })
await pageObject.selectAppTag({ tag, app, world })
}

export async function selectTag({
actorsEnvironment,
stepUser,
tag
tag,
world
}: {
actorsEnvironment: ActorsEnvironment
stepUser: string
tag: string
world?: World
}): Promise<void> {
const { page } = actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.appStore.AppStore({ page })
await pageObject.selectTag(tag)
await pageObject.selectTag(tag, world)
}
1 change: 1 addition & 0 deletions tests/e2e-playwright/steps/ui/application.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ActorsEnvironment } from '../../../e2e/support/environment/index.js'
import { objects } from '../../../e2e/support'
import { World } from '../../../e2e/cucumber/environment'

export async function openApplication({
actorsEnvironment,
Expand Down
Loading