Skip to content

Commit

Permalink
[Storage] Add and delete s3 key test (#2241)
Browse files Browse the repository at this point in the history
* add and delete a storage api key test

* fix navigate to api keys page in mobile context

* add and delete s3 key
  • Loading branch information
juans-chainsafe authored Aug 19, 2022
1 parent dbb3031 commit 029c24b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions packages/storage-ui/cypress/tests/api-keys-management.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,32 @@ describe("Main Navigation", () => {
apiKeysPage.deleteMenuOption().click()
apiKeysPage.apiKeyIdCell().should("not.exist")
})

it("can add and delete a s3 api key", () => {
// go to api keys section
navigationMenu.apiKeysNavButton().click()

// add new s3 api key
apiKeysPage.addS3KeyButton().click()
newKeyModal.secretLabel().should("be.visible")
newKeyModal.keyIdLabel().invoke("text").as("keyId")
newKeyModal.closeButton().click()

// ensure new key modal is closed and api key button is enabled
newKeyModal.secretLabel().should("not.exist")
apiKeysPage.addS3KeyButton().should("be.enabled")

// ensure key id and status are correct in the table
cy.get<string>("@keyId").then((keyId) => {
apiKeysPage.apiKeyIdCell().should("have.text", keyId)
})
apiKeysPage.apiKeyTypeCell().should("have.text", "s3")

// delete s3 key
apiKeysPage.apiKeyRowKebabButton().click()
apiKeysPage.deleteMenuOption().click()
apiKeysPage.apiKeyIdCell().should("not.exist")
})
})

})

0 comments on commit 029c24b

Please sign in to comment.