aboutsummaryrefslogtreecommitdiffstats
path: root/cypress
diff options
context:
space:
mode:
authorLouis Chemineau <louis@chmn.me>2023-03-22 18:27:54 +0100
committerLouis Chemineau <louis@chmn.me>2023-03-30 10:09:13 +0200
commitf882446f38febbddb184abe37c25d9aba4e0e72f (patch)
treed41e399f2190d09f8d8a8afbfe08386aee2f74e9 /cypress
parentc0ff8789c36df4d6fc464e663b210cedd0dbc487 (diff)
downloadnextcloud-server-f882446f38febbddb184abe37c25d9aba4e0e72f.tar.gz
nextcloud-server-f882446f38febbddb184abe37c25d9aba4e0e72f.zip
Try to chain cypress commands
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'cypress')
-rw-r--r--cypress/e2e/files_versions/filesVersionsUtils.ts17
1 files changed, 8 insertions, 9 deletions
diff --git a/cypress/e2e/files_versions/filesVersionsUtils.ts b/cypress/e2e/files_versions/filesVersionsUtils.ts
index 4b8006b0471..ce37b88a086 100644
--- a/cypress/e2e/files_versions/filesVersionsUtils.ts
+++ b/cypress/e2e/files_versions/filesVersionsUtils.ts
@@ -23,15 +23,14 @@
import path from "path"
export function uploadThreeVersions(user) {
- cy.uploadContent(user, new Blob(['v1'], { type: 'text/plain' }), 'text/plain', '/test.txt')
// A new version will not be created if the changes occur
// within less than one second of each other.
// eslint-disable-next-line cypress/no-unnecessary-waiting
- cy.wait(1500)
- cy.uploadContent(user, new Blob(['v2'], { type: 'text/plain' }), 'text/plain', '/test.txt')
- // eslint-disable-next-line cypress/no-unnecessary-waiting
- cy.wait(1500)
- cy.uploadContent(user, new Blob(['v3'], { type: 'text/plain' }), 'text/plain', '/test.txt')
+ cy.uploadContent(user, new Blob(['v1'], { type: 'text/plain' }), 'text/plain', '/test.txt')
+ .wait(1500)
+ .uploadContent(user, new Blob(['v2'], { type: 'text/plain' }), 'text/plain', '/test.txt')
+ .wait(1500)
+ .uploadContent(user, new Blob(['v3'], { type: 'text/plain' }), 'text/plain', '/test.txt')
cy.login(user)
}
@@ -56,7 +55,7 @@ export function openVersionMenu(index: number) {
cy.get('[data-files-versions-version]')
.eq(index).within(() => {
cy.get('.action-item__menutoggle').filter(':visible')
- .click()
+ .click()
})
})
}
@@ -69,7 +68,7 @@ export function clickPopperAction(actionName: string) {
export function nameVersion(index: number, name: string) {
openVersionMenu(index)
- clickPopperAction("Name this version")
+ clickPopperAction('Name this version')
cy.get(':focused').type(`${name}{enter}`)
}
@@ -77,7 +76,7 @@ export function assertVersionContent(index: number, expectedContent: string) {
const downloadsFolder = Cypress.config('downloadsFolder')
openVersionMenu(index)
- clickPopperAction("Download version")
+ clickPopperAction('Download version')
return cy.readFile(path.join(downloadsFolder, 'test.txt'))
.then((versionContent) => expect(versionContent).to.equal(expectedContent))