{"id":22389761,"url":"https://github.com/entando/entando-test-automation","last_synced_at":"2025-08-17T16:11:20.522Z","repository":{"id":37864087,"uuid":"381097512","full_name":"entando/entando-test-automation","owner":"entando","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-22T09:08:17.000Z","size":1879,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":16,"default_branch":"develop","last_synced_at":"2025-02-01T03:27:44.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/entando.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-28T16:34:08.000Z","updated_at":"2022-01-10T08:46:45.000Z","dependencies_parsed_at":"2025-02-01T03:26:32.239Z","dependency_job_id":"d94691a0-0d9f-4f67-bc79-0b1f6964b0db","html_url":"https://github.com/entando/entando-test-automation","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entando%2Fentando-test-automation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entando%2Fentando-test-automation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entando%2Fentando-test-automation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entando%2Fentando-test-automation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/entando","download_url":"https://codeload.github.com/entando/entando-test-automation/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245737926,"owners_count":20664182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-05T03:13:12.283Z","updated_at":"2025-03-26T21:27:05.824Z","avatar_url":"https://github.com/entando.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Guide for configuring and running the Cypress tests\n\n### Clone the project and install the node dependencies\n- `git clone https://github.com/entando/entando-test-automation.git`\n- `cd entando-test-automation/ui-tests`\n- `npm install`\n### Define your Entando environment in the configuration file\n- `cd configs`\n- Edit the `configs.json` file and change the following values:\n1) in `baseURL`: replace {YOUR_ENTANDO_BASE_URL} with the base URL of your Entando environment\n2) in `api_client_id`: replace {YOUR_API_CLIENT_ID} with your API client ID\n3) in `api_client_secret`: replace {YOUR_API_CLIENT_SECRET} with your API client secret\n### Change the set password for the admin user\nThe Cypress test suite uses the login information found in `entando-test-automation/ui-tests/cypress/fixtures/users/login/admin.json`.\nIf your Entando environment's admin account has a user/password pair different from `username: admin`/`password: adminadmin`:\n- Go to `entando-test-automation/ui-tests/cypress/fixtures/users/login/`\n- Edit the `admin.json` file and change the `password` value to the password your admin account uses\n### Run the Cypress tests\nThe following commands to run the tests have to be run from inside the `entando-test-automation/ui-tests` folder:\n- `npx cypress run`: this command runs the entire test suite\n- `npx cypress run --spec \"./cypress/e2e/{PATH}/{FILE_NAME}.cy.js\"`: this command runs a specific test spec file\n- `npm run cypress:{TAG}`: this command runs a script that selects only certain tests to run. These are the currently used tags for the script:\n```\nsmoke\nsanity\nfeature\nerror\nedge\nacceptance\ngts\nbundle\nexcludebundle\nall\n```\n**The complete commands to run tests with specific tags are:**\n- `CYPRESS_INCLUDE_TAGS={TAG} npx cypress run`: runs all tests with the specified tag\n- `CYPRESS_INCLUDE_TAGS={TAG1},{TAG2} npx cypress run`: runs all tests with either one of the specified tags\n- `CYPRESS_INCLUDE_USE_BOOLEAN_AND=true CYPRESS_INCLUDE_TAGS={TAG1},{TAG2} npx cypress run`: runs only the tests that have **both** of the specified tags\n- `CYPRESS_EXCLUDE_TAGS={TAG} npx cypress run`: runs all tests except the ones with the specified tag\n\nThe tags currently used for the above commands are:\n```\nWIP\nGTS\nSMOKE\nSANITY\nFEATURE\nERROR\nEDGE\nACCEPTANCE\nBUNDLE\n```\nReferences and additional information on the tag commands -\u003e [cypress-tags](https://github.com/infosum/cypress-tags)\n\nFor debugging and to run tests while still writing them, it can be useful to run them using the Cypress open feature:\n- `npx cypress open`: this command opens an interface where specific spec files can be run individually in the browser and can be seen and examined as they go, including \"time travel\" once the test is over, to examine the state of the page at the time of each given command (to learn more: [Cypress App documentation](https://docs.cypress.io/guides/core-concepts/cypress-app))\n### Check test results\nWhen running the tests with any of the `run` commands, a `results` folder will be created in `entando-test-automation/ui-tests/cypress`, which contains an `index.html` file which can be opened to check the results of the test. For each failed test, a screenshot will also be present.\n\n---\n\n### Project structure and guidelines for test writing\n\nThe project uses the Page Object structure, where each page and/or component of the web application has a corresponding file that describes its structure using function and variables that point to relevant elements of the page.\nThe page objects are inside `entando-test-automation/ui-tests/cypress/support/pageObjects` and the folder structure is divided by following the App Builder sections.\nTests are stored inside `entando-test-automation/ui-tests/cypress/e2e` and the structure mimics the App Builder sections here as well.\nOther than the `pageObjects` folder, the `support` folder contains common commands, utilities, controllers for the API calls, as well as other Cypress global configuration settings.\nThe `entando-test-automation/ui-tests/cypress/fixtures` folder and subfolders contain fixtures that are used in tests (e.g. files to be uploaded, or JSON files containing set configurations)\nEach test usually has to start with these two commands, which will be generally run in a `beforeEach` hook:\n1) `cy.kcClientCredentialsLogin()`: performs the login to keycloak with the configured confidential client with grant type client_credentials and stores the response with the alias `tokens`\n2) `cy.kcAuthorizationCodeLoginAndOpenDashboard('login/admin')`: calls `kcAuthorizationCodeLogin` and opens the App Builder dashboard (`kcAuthorizationCodeLogin` performs the login to keycloak with the configured public client for the specified user with grant type authorization_code and stores the response with the alias `UITokens`)\n\nAfter the above commands have been launched in a test suite, the App Builder homepage's page object will be set as the Cypress label `currentPage`. This label gets used throughout the tests to reference the current page object being used.\nUsage example:\n```\ncy.get('@currentPage')\n   .then(page =\u003e page.getMenu().getAdministration().open().openDatabase())\n   .then(page =\u003e page.getContent().getCreateBackupButton().should('exist').and('be.visible');\n```\nThe cy.get command gets the variable set with the label 'currentPage' (e.g.: the App Builder dashboard/homepage). Using the functions in the HomePage page object, Cypress opens the side menu section 'Administration' and subsequently the subsection 'Database'. 'page' is now no longer pointing to the HomePage page object, but to the DatabasePage page object, and this command is asserting the existence and visibility of the 'Create Backup' button by using functions in this page object.\nInside a page object, a function that would move the browser to a different page should also update the `currentPage` label. For example, the above function `openDatabase`:\n```\n  openDatabase() {\n    this.getDatabase().then(button =\u003e DatabasePage.openPage(button));\n    return cy.wrap(new AppPage(DatabasePage)).as('currentPage');\n  }\n```\nThis creates a new AppPage page object (the generic App Builder page), with its content set as DatabasePage.\nEach test ends with the `cy.kcTokenLogout()` command, which performs the logout of the user associated with the stored value `UITokens`.\n\nReferences -\u003e [Cypress Documentation](https://docs.cypress.io/guides/overview/why-cypress)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentando%2Fentando-test-automation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fentando%2Fentando-test-automation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentando%2Fentando-test-automation/lists"}