Skip to content
Merged
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"licenses:save": "license-checker-rseidelsohn --relativeLicensePath --out /dev/null --files ./third-party-licenses/third-party-licenses",
"vite": "vue-demi-fix && vite",
"check:types": "pnpm build:tokens && vue-tsc --noEmit",
"check:all": "pnpm check:types && pnpm lint --fix && pnpm format:write && pnpm test:unit"
"check:all": "pnpm check:types && pnpm lint --fix && pnpm format:write && pnpm test:unit",
"check:unused-steps": "TS_NODE_PROJECT=./tests/e2e/cucumber/tsconfig.json cucumber-js --profile=e2e --format usage --dry-run tests/e2e/cucumber/features/*/*.feature"
},
"browserslist": [
"last 1 year",
Expand Down
39 changes: 0 additions & 39 deletions tests/e2e/cucumber/steps/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,26 +214,6 @@ Given(
}
)

Given(
'{string} creates {int} file(s) in space {string} using API',
async function (
this: World,
stepUser: string,
numberOfFiles: number,
space: string
): Promise<void> {
const user = this.usersEnvironment.getCreatedUser({ key: stepUser })
for (let i = 1; i <= numberOfFiles; i++) {
await api.dav.uploadFileInsideSpaceBySpaceName({
user,
pathToFile: `testfile${i}.txt`,
spaceName: space,
content: `This is a test file${i}`
})
}
}
)

Given(
'{string} creates the following folder(s) in space {string} using API',
async function (
Expand All @@ -253,25 +233,6 @@ Given(
}
)

Given(
'{string} creates {int} folders(s) in space {string} using API',
async function (
this: World,
stepUser: string,
numberOfFolders: number,
space: string
): Promise<void> {
const user = this.usersEnvironment.getCreatedUser({ key: stepUser })
for (let i = 1; i <= numberOfFolders; i++) {
await api.dav.createFolderInsideSpaceBySpaceName({
user,
folder: `testFolder${i}`,
spaceName: space
})
}
}
)

Given(
'{string} adds the following member(s) to the space {string} using API',
async function (
Expand Down
9 changes: 0 additions & 9 deletions tests/e2e/cucumber/steps/ui/adminSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,15 +155,6 @@ When(
}
)

When(
'{string} navigates to the general management page',
async function (this: World, stepUser: string): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.applicationAdminSettings.page.General({ page })
await pageObject.navigate()
}
)

When(
'{string} changes the quota of the user {string} to {string} using the sidebar panel',
async function (this: World, stepUser: string, key: string, value: string): Promise<void> {
Expand Down
31 changes: 0 additions & 31 deletions tests/e2e/cucumber/steps/ui/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,28 +166,6 @@ When(
}
)

Then(
'public link named {string} should be visible to {string}',
async function (this: World, linkName: string, stepUser: any): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const expectedPublicLink = this.linksEnvironment.getLink({ name: linkName })
const linkObject = new objects.applicationFiles.Link({ page })
const actualPublicLink = await linkObject.getPublicLinkUrl({ linkName, space: true })
expect(actualPublicLink).toBe(expectedPublicLink)
}
)

Then(
'public link named {string} of the resource {string} should be visible to {string}',
async function (this: World, linkName: string, resource: string, stepUser: any): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const expectedPublicLink = this.linksEnvironment.getLink({ name: linkName })
const linkObject = new objects.applicationFiles.Link({ page })
const actualPublicLink = await linkObject.getPublicLinkUrl({ linkName, resource })
expect(actualPublicLink).toBe(expectedPublicLink)
}
)

Then(
/^"([^"]*)" (should|should not) be able to edit the public link named "([^"]*)"$/,
async function (
Expand Down Expand Up @@ -223,15 +201,6 @@ When(
}
)

When(
'{string} opens shared-with-me page from the internal link',
async function (this: World, stepUser: string): Promise<void> {
const actor = this.actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.applicationFiles.page.shares.WithMe({ page: actor.page })
await pageObject.openShareWithMeFromInternalLink(actor)
}
)

When(
'{string} copies the link {string} of resource {string}',
async function (
Expand Down
31 changes: 0 additions & 31 deletions tests/e2e/cucumber/steps/ui/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,28 +165,6 @@ When(
}
)

When(
'{string} uploads the following resource(s) in internal link named {string}',
async function (
this: World,
stepUser: string,
link: string,
stepTable: DataTable
): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const pageObject = new objects.applicationFiles.page.Public({ page })
const { url } = this.linksEnvironment.getLink({ name: link })
for (const info of stepTable.hashes()) {
await pageObject.uploadInternal({
to: info.to,
resources: [this.filesEnvironment.getFile({ name: info.resource })],
option: info.option,
link: url
})
}
}
)

Then(
'{string} should not be able to open the old link {string}',
async function (this: World, stepUser: string, name: string): Promise<void> {
Expand All @@ -210,12 +188,3 @@ When(
await processDelete(stepTable, pageObject, actionType)
}
)

Then(
'for {string} file {string} should be selected',
async function (this: World, stepUser: string, fileName: string): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const resourceObject = new objects.applicationFiles.Resource({ page })
await resourceObject.expectFileToBeSelected({ fileName: fileName })
}
)
23 changes: 0 additions & 23 deletions tests/e2e/cucumber/steps/ui/resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,29 +731,6 @@ When(
}
)

Then(
'{string} should not see the version of the file(s)',
async function (this: World, stepUser: string, stepTable: DataTable): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const resourceObject = new objects.applicationFiles.Resource({ page })
const fileInfo = stepTable.hashes().reduce<Record<string, File[]>>((acc, stepRow) => {
const { to, resource } = stepRow

if (!acc[to]) {
acc[to] = []
}

acc[to].push(this.filesEnvironment.getFile({ name: resource }))

return acc
}, {})

for (const folder of Object.keys(fileInfo)) {
await resourceObject.checkThatFileVersionIsNotAvailable({ folder, files: fileInfo[folder] })
}
}
)

Then(
'{string} should not see the version panel for the file(s)',
async function (this: World, stepUser: string, stepTable: DataTable): Promise<void> {
Expand Down
4 changes: 0 additions & 4 deletions tests/e2e/cucumber/steps/ui/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ async function LogInUser(this: World, stepUser: string): Promise<void> {
await page.locator('#web-content').waitFor()
}

Given('{string} has logged in', LogInUser)

When('{string} logs in', LogInUser)

async function LogOutUser(this: World, stepUser: string): Promise<void> {
Expand All @@ -53,8 +51,6 @@ async function LogOutUser(this: World, stepUser: string): Promise<void> {
await actor.close()
}

Given('{string} has logged out', LogOutUser)

When('{string} logs out', LogOutUser)

Then('{string} fails to log in', async function (this: World, stepUser: string): Promise<void> {
Expand Down
9 changes: 0 additions & 9 deletions tests/e2e/cucumber/steps/ui/shares.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,6 @@ When(
}
)

When(
'{string} should not be able to open the folder/file {string}',
async function (this: World, stepUser: string, resource: string): Promise<void> {
const { page } = this.actorsEnvironment.getActor({ key: stepUser })
const shareObject = new objects.applicationFiles.Share({ page })
expect(await shareObject.resourceIsNotOpenable(resource)).toBe(true)
}
)

When(
/"([^"]*)" (should|should not) see a sync status for the (?:folder|file) "([^"]*)"?$/,
async function (
Expand Down
20 changes: 0 additions & 20 deletions tests/e2e/support/objects/app-files/link/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const publicLinkEditRoleButton = `//span[contains(@class, "files-links-name") an
const addPublicLinkButton = '#files-file-link-add'
const publicLinkNameList =
'//div[@id="oc-files-file-link"]//ul//span[contains(@class, "files-links-name")]'
const publicLink = `//ul//h4[text()='%s']/following-sibling::div//p`
const publicLinkCurrentRole =
'//button[contains(@class,"link-role-dropdown-toggle")]//span[contains(@class,"link-current-role")]'
const linkUpdateDialog = '//div[contains(@class,"oc-notification-message-title")]'
Expand Down Expand Up @@ -306,25 +305,6 @@ export const deleteLink = async (args: deleteLinkArgs): Promise<void> => {
expect(message.trim()).toBe('Link was deleted successfully')
}

export const getPublicLinkVisibility = async (
args: publicLinkAndItsEditButtonVisibilityArgs
): Promise<string> => {
const { page, linkName, resource, space } = args
let shareType = 'space-share'
let resourceName = null
if (!space) {
shareType = 'sharing'
const resourcePaths = resource.split('/')
resourceName = resourcePaths.pop()
if (resourcePaths.length) {
await clickResource({ page: page, path: resourcePaths.join('/') })
}
}
await sidebar.open({ page: page, resource: resourceName })
await sidebar.openPanel({ page: page, name: shareType })
return await page.locator(util.format(publicLink, linkName)).textContent()
}

export const getLinkEditButtonVisibility = async (
args: publicLinkAndItsEditButtonVisibilityArgs
): Promise<boolean> => {
Expand Down
9 changes: 0 additions & 9 deletions tests/e2e/support/objects/app-files/link/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ export class Link {
await this.#page.goto(startUrl)
}

getPublicLinkUrl(
args: Omit<po.publicLinkAndItsEditButtonVisibilityArgs, 'page'>
): Promise<string> {
return po.getPublicLinkVisibility({
...args,
page: this.#page
})
}

async islinkEditButtonVisibile(linkName: string): Promise<boolean> {
return await po.getLinkEditButtonVisibility({ page: this.#page, linkName })
}
Expand Down
10 changes: 0 additions & 10 deletions tests/e2e/support/objects/app-files/page/public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,6 @@ export class Public {
await this.#page.locator('body').click()
}

async uploadInternal(
args: Omit<po.uploadResourceArgs, 'page'> & { link: string }
): Promise<void> {
// link is the public link url
const { link } = args
delete args.link
await po.uploadResource({ ...args, page: this.#page })
await this.#page.goto(link)
}

async delete(args: Omit<po.deleteResourceArgs, 'page'>): Promise<void> {
const startUrl = this.#page.url()
await po.deleteResource({ ...args, page: this.#page, isPublicLink: true })
Expand Down
12 changes: 0 additions & 12 deletions tests/e2e/support/objects/app-files/page/shares/withMe.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import { Page } from '@playwright/test'
import { Actor } from '../../../../../support/types'

const sharesNavSelector = '//a[@data-nav-name="files-shares"]'
const openShareWithMeButton = `//a/span[text()='Open "Shared with me"']`
const shareWithMeNavSelector = '//a/span[text()="Shared with me"]'

export class WithMe {
#page: Page
Expand All @@ -15,13 +12,4 @@ export class WithMe {
async navigate(): Promise<void> {
await this.#page.locator(sharesNavSelector).click()
}

async openShareWithMeFromInternalLink(actor: Actor): Promise<void> {
const [newTab] = await Promise.all([
this.#page.waitForEvent('popup'),
this.#page.locator(openShareWithMeButton).click()
])
await newTab.locator(shareWithMeNavSelector).waitFor()
actor.savePage(newTab)
}
}
37 changes: 0 additions & 37 deletions tests/e2e/support/objects/app-files/resource/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const tagInInputForm =
'//span[contains(@class, "tags-select-tag")]//span[text()="%s"]//ancestor::span//button[contains(@class, "vs__deselect")]'
const tagFormInput = '//*[@data-testid="tags"]//input'
const resourcesAsTiles = '#files-view .oc-tiles'
const fileVersionSidebar = '#oc-file-versions-sidebar'
const versionsPanelSelect = '//*[@data-testid="sidebar-panel-versions-select"]'
const noLinkMessage = '#web .oc-link-resolve-error-message'
const listItemPageSelector = '//*[contains(@class,"oc-pagination-list-item-page") and text()="%s"]'
Expand Down Expand Up @@ -1869,27 +1868,6 @@ export const previewMediaFromSidebarPanel = async ({
await page.locator(util.format(sideBarActionButton, 'Preview')).first().click()
}

export const checkThatFileVersionIsNotAvailable = async (
args: resourceVersionArgs
): Promise<void> => {
const { page, files, folder } = args
const fileName = files.map((file) => path.basename(file.name))
await clickResource({ page, path: folder })

await Promise.all([
page.waitForResponse(
(resp) =>
resp.url().includes('dav/meta') &&
resp.status() === 403 &&
resp.request().method() === 'PROPFIND'
),
sidebar.open({ page, resource: fileName[0] })
])

await sidebar.openPanel({ page, name: 'versions' })
await expect(page.locator(fileVersionSidebar)).toHaveText('No versions available for this file')
}

export const checkThatFileVersionPanelIsNotAvailable = async (
args: resourceVersionArgs
): Promise<void> => {
Expand Down Expand Up @@ -1969,21 +1947,6 @@ export const expectPageNumberNotToBeVisible = async ({ page }: { page: Page }):
await expect(page.locator(filesPaginationNavSelector)).not.toBeVisible()
}

export interface expectFileToBeSelectedArgs {
page: Page
fileName: string
}

export const expectFileToBeSelected = async ({
page,
fileName
}: {
page: Page
fileName: string
}): Promise<void> => {
await expect(page.locator(util.format(checkBox, fileName))).toBeChecked()
}

export const createShotcut = async (args: shortcutArgs): Promise<void> => {
const { page, resource, name, type } = args
await page.locator(addNewResourceButton).click()
Expand Down
Loading