Skip to content

Commit

Permalink
Fix test and remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
nfranzeck committed Jul 13, 2023
1 parent 5b668df commit a0dd591
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
7 changes: 2 additions & 5 deletions integrationTests/cypress/e2e/user_replication.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,5 @@ Feature: CAS user data replication
@requires_testuser
Scenario: test user data is replicated in SonarQube
Given the user is logged into the CES
When the user opens the dogu start page
And the user clicks the user menu button
And the user clicks the My Account button
Then the user is redirected to the account site
And the page shows the replicated data of the user in tabular form
When the user navigates to "/account" page
Then the page shows the replicated data of the user in tabular form
8 changes: 0 additions & 8 deletions integrationTests/cypress/support/step_definitions/then.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ Then(/^the user can not access the SonarQube API with wrong username and passwor
cy.requestSonarAPI("/users/search", "NoVaLiDUSRnam33", "ThIsIsNoTaP4$$worD", false, 401)
});

Then(/^the user is redirected to the SonarQube issue page$/, function () {
cy.url().should('contain', Cypress.config().baseUrl + "/" + env.GetDoguName() + "/issues?resolved=false")
});

Then(/^the user can access the Web API with the User Token$/, function () {
cy.fixture("testuser_data").then((testuserdata) => {
cy.getCookie(testuserdata.sonarqubeToken).should('exist').then((cookie) => {
Expand Down Expand Up @@ -85,10 +81,6 @@ Then(/^the user can access the \/users\/groups Web API endpoint$/, function () {
})
});

Then(/^the user is redirected to the account site$/, function () {
cy.url().should('eq', Cypress.config().baseUrl + "/" + env.GetDoguName() + "/account")
});

Then(/^the user can not access the \/users\/groups Web API endpoint$/, function () {
cy.fixture("testuser_data").then((testuserdata) => {
cy.requestSonarAPI("/users/groups?login=" + testuserdata.username, testuserdata.username, testuserdata.password, false, 403)
Expand Down
16 changes: 4 additions & 12 deletions integrationTests/cypress/support/step_definitions/when.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ const {

const env = require('@cloudogu/dogu-integration-test-library/lib/environment_variables')

When(/^the user clicks the user menu button$/, function () {
cy.get('*[class^="dropdown-toggle navbar-avatar"]').scrollIntoView().click();
});

When(/^the user clicks the My Account button$/, function () {
cy.get('*[class^="popup is-bottom"]').contains("My Account").click();
});

When(/^the user opens the SonarQube issue page$/, function () {
cy.visit("/" + env.GetDoguName() + "/issues?resolved=false", {failOnStatusCode: false})
});

When(/^the user creates a User Token via the Web API$/, function () {
cy.fixture("testuser_data").then(function (testuserdata) {
cy.clearCookies()
Expand All @@ -39,4 +27,8 @@ When(/^the admin user requests his\/her attributes via the \/users API endpoint$
cy.requestSonarAPI("/users/search?q=" + env.GetAdminUsername(), env.GetAdminUsername(), env.GetAdminPassword()).then(function (response) {
cy.setCookie("adminuserattributes", JSON.stringify(response.body))
})
});

When("the user navigates to {string} page", function (name) {
cy.visit("/" + env.GetDoguName() + name, {failOnStatusCode: false})
});

0 comments on commit a0dd591

Please sign in to comment.