UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit 0fc20b64 authored by Jimmy Bourque's avatar Jimmy Bourque
Browse files

Used shared command for project deletion and tweaked user deletion portion

parent 5321d82b
No related branches found
No related tags found
1 merge request!245Cypress updates
Pipeline #2778411 failed
This commit is part of merge request !245. Comments created here will be created in the context of that merge request.
......@@ -68,11 +68,7 @@ describe('Create Gitlab Project and Cleanup Resources Created', () => {
// Validate project can be created and then delete to clean up resources
cy.createGitlabProject(Cypress.env('url'), Cypress.env('gitlab_project'))
cy.visit(`${Cypress.env('url')}/${Cypress.env('gitlab_username')}/${Cypress.env('gitlab_project')}/edit`)
cy.get('section[data-testid="advanced-settings-content"]').contains('span', 'Expand').click()
cy.get('button[data-testid="delete-button"]').click()
cy.get('input[data-testid="confirm-name-field"]').type(`${Cypress.env('gitlab_username')}/${Cypress.env('gitlab_project')}`)
cy.get('button[data-testid="confirm-delete-button"]').click()
cy.deleteGitlabProject(Cypress.env('url'), Cypress.env('gitlab_username'), Cypress.env('gitlab_project'))
})
it('Login as Root and Delete Test User', () => {
// clear user data before starting test
......@@ -87,11 +83,13 @@ describe('Create Gitlab Project and Cleanup Resources Created', () => {
cy.get('div[data-testid="user-actions-2"]').find('button[data-testid="base-dropdown-toggle"]').click()
cy.get('li[data-testid="delete-deleteWithContributions"]').find('button').click()
cy.get('input[name="username"]').type(`${Cypress.env('gitlab_first_name')} ${Cypress.env('gitlab_last_name')}`)
cy.contains('span', 'Delete user and contributions').click({force: true})
//Wait for user deletion to complete before validating user no longer exists
//Unfortunately, there is no API call to listen to here so it has to be an explicit wait
cy.wait(3000)
//Start listening for user list refresh prior to moving on to validation
cy.intercept('GET', '**/admin/users').as('userListCall')
cy.contains('span', 'Delete user and contributions').click({force: true})
cy.wait('@userListCall').then((interception) => {
expect(interception.response.statusCode).to.equal(200)
})
//Validate user is gone
cy.visit(`${Cypress.env('url')}/admin/users?search_query=${Cypress.env('gitlab_email')}&sort=name_asc`)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment