Skip to content

Commit

Permalink
e2e test setup & test implementation (#12)
Browse files Browse the repository at this point in the history
* adding feature file

* adding cucumber config

* adding test:e2e script to package.json

* adding 3DViewerContext.ts including boilerplate steps

* fix typo

* adding some selectors

* adding a file for testing

* fix indentation

* add cucumber.cjs

* add e2e config.js

* update test:e2e

* rename ViewerContext.ts and move selectors to new script in pageObjects

* add some more config stuff

* refactor config, move stuff into hooks script

* update feature file

* update steps

* fix import

* update feature file and steps

* add specific feature to script since there is only one feature

* adding more models for testing

* add column title for data table

* draft implementation of steps

* add imports

* updating base url

* remove user store (for simplicity, since we only have one user in the given scenario)

* implement first 5 steps of the scenario & adding some notes for checking mouse input

* skip steps related to rotate, zoom and reset for now

* adding boilerplate code for check fullscreen mode & check standard display mode

still needs to be implemented properly

* code clean up

* adding lint:fix

* add missing comma

* remove lint

* adding lint again

* code style improvements by lint

* adding lint:fix

* deactivate step regarding topbar visibility in full screen mode

* adding test for full screen mode

* lint improvements

* remove unnecessary code

* adding test for existence of fullscreen pseudo class

* remove vue gettext

Co-authored-by: Sawjan Gurung <[email protected]>

* remove empty lines

Co-authored-by: Sawjan Gurung <[email protected]>

* remove playwright dependency

Co-authored-by: Sawjan Gurung <[email protected]>

* Update pnpm-lock.yaml

* extending from root tsconfig

* uncommenting unnecessary line in scenario

* removing @ownclouders/tsconfig dependency

Co-authored-by: Sawjan Gurung <[email protected]>

* Update pnpm-lock.yaml

* remove unnecessary steps from scenario

* remove unneeded step implementation and refactor checkTopbarVisibility() function

* Update cucumber.cjs

avoid using require config.js

Co-authored-by: Sawjan Gurung <[email protected]>

* make login function static

Co-authored-by: Sawjan Gurung <[email protected]>

* renaming config.js to config.ts

* adding node dependency

* remove unused selector

* set response type to any

* change file type back to js

* fix typo in header of config

* fix syntax error about static async

* undo static login

* fix lint error

* refactoring adding Ocis pageObject

* convert config.js to .ts

* using path instead of join-path

Co-authored-by: Sawjan Gurung <[email protected]>

* adding path. prefix

* removing join-path dependency

* Update tests/e2e/config.ts

Co-authored-by: Sawjan Gurung <[email protected]>

* removing unused import

* trying to make functions in Ocis.ts static

* refactoring (creating helpers.ts)

* refactoring deleteAllFiles()

* fix lint error

* adding PROXY_ENABLE_BASIC_AUTH

* update scenario

* Refactoring how files are uploaded and deleted (using API instead of UI), added try/catch for makeApiRequest

* fix lint issues

* storing filenames and deleting all files dynamically after test

* moving previewFile to Ocis.ts, code cleanup

* refactoring (define getter in pageObject, do assertion in Context)

WiP

* add error message if uploadFile is not successful

* defining response

* fix error in full screen assertion step

* fix lint errors

* remove state and use global variable instead

* fix imports

* move viewer and ocis constructor outside the steps

* refactor remaining steps

* pseudo code implementation of model modification

* adding modifyModelRotation() function

* implementing modifyModelZoom() and removing some other code and comments

* changes in viewer context

* updating steps

* replacing previous models with smaller models

the models are from https://3dexport.com/ and were originally called Low Poly Tree GLTF.glb and Tea-pot_glb.glb

* removing logout function that is no longer used in any step of the tests

* remove unused helper function and update values for zoom

* fix lint error

* clean up code

* remove empty space

Co-authored-by: Sawjan Gurung <[email protected]>

* remove comment

Co-authored-by: Sawjan Gurung <[email protected]>

* remove section regarding rotate, zoom & reset from scenario

* remove implementation of these steps

* remove functions related to the steps that have been removed

* fix delay with playwright function

* update misspelling in step

* make assertion stricter

* adding assert for first given step

* correcting lint error

* rename helper function

* remove some comment

* change "fullscreen" to "full screen"

* update name of button

* renaming feature file

* updating package.json

* make check of viewport description tighter to avoid flaky tests

* fix lint error

* renaming file

* renaming file

* renaming steps file

* adding assertion for successful login

* assert status code for file upload

* return response status code for delete file

* refactoring deleteAllFiles method

* fix lint error

* adding status check for emptyTrashbin method

* Update and rename ModelViewerPage.ts to modelViewerPage.ts

* Update and rename OcisWebPage.ts to ocisWebPage.ts

* update import

* updating test:e2e script

---------

Co-authored-by: Sawjan Gurung <[email protected]>
  • Loading branch information
koebel and saw-jan authored Jul 19, 2024
1 parent c8408d4 commit 7a1862f
Show file tree
Hide file tree
Showing 15 changed files with 1,312 additions and 66 deletions.
10 changes: 10 additions & 0 deletions cucumber.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
default: {
require: ["tests/e2e/**/*.ts"],
requireModule: ["ts-node/register"],
retry: process.env.RETRY || 0,
format: ["@cucumber/pretty-formatter"]
}
}

// see https://github.com/cucumber/cucumber-js/blob/main/docs/configuration.md for documentation
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ services:
OCIS_INSECURE: true
OCIS_LOG_LEVEL: error
IDM_ADMIN_PASSWORD: admin
PROXY_ENABLE_BASIC_AUTH: true
WEB_UI_CONFIG_FILE: /etc/ocis/web.json
volumes:
- ./dev/web.json:/etc/ocis/web.json:ro
Expand Down
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"scripts": {
"build": "pnpm vite build",
"build:w": "pnpm vite build -w -m development",
"lint": "eslint './*.{js,ts}' '{src,tests}/**/*.{js,ts,vue}' --color"
"test:e2e": "NODE_TLS_REJECT_UNAUTHORIZED=0 TS_NODE_PROJECT=./tests/e2e/tsconfig.json cucumber-js tests/e2e/features/",
"lint": "eslint './*.{js,ts}' '{src,tests}/**/*.{js,ts,vue}' --color",
"lint:fix": "pnpm lint --fix"
},
"keywords": [
"owncloud",
Expand All @@ -20,17 +22,24 @@
],
"devDependencies": {
"@babel/eslint-parser": "^7.23.10",
"@cucumber/cucumber": "^10.3.1",
"@cucumber/pretty-formatter": "^1.0.0",
"@ownclouders/extension-sdk": "0.0.5-alpha.2",
"@ownclouders/prettier-config": "^0.0.1",
"@playwright/test": "^1.41.2",
"@types/node": "^20.12.2",
"@types/three": "^0.161.2",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@vitejs/plugin-vue": "^4.0.0",
"axios": "^1.6.7",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier-vue": "^5.0.0",
"eslint-plugin-unused-imports": "^3.1.0",
"eslint-plugin-vue": "^9.23.0",
"lodash": "^4.17.21",
"three": "^0.160.0",
"ts-node": "^10.9.2",
"vite": "^5.0.12",
"vue": "^3.4.15"
},
Expand Down
Loading

0 comments on commit 7a1862f

Please sign in to comment.