-
Notifications
You must be signed in to change notification settings - Fork 30
public-key-creation #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,22 @@ | ||||||
| describe('Deploy Key Creation', () => { | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. O nome do arquivo deveria seguir a convenção camelCase, ou seja, em vez de
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Além disso, visto que o teste é do domínio |
||||||
| beforeEach(() => cy.sessionLogin()) | ||||||
|
|
||||||
| it('creates an key ', () => { | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Além disso, visto que isso é um teste de CRUD, faltou o update. Ao testar o update, verificar mensagem de sucesso, além de verificar que o título foi atualizado. |
||||||
| /** | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remover comentários desnecessários. |
||||||
| * início | ||||||
| * 1 -Acesssa a sessionLogin | ||||||
| * 2 - Uso dois comandos customizados que são eles: | ||||||
| * gui_deployKeyCreationName() , para gerar um nome aleatório para a key | ||||||
| * gui_deployKeyCreation() , contém a key publica na variável "const publicKey" com valor da key gerada antes | ||||||
| * 3 - verifica o número de key(s), se é igual a (1) assert, caso seja, | ||||||
| * passa para o próximo step que é clique btn "remove" | ||||||
| * 4 - Clique no BTN "remove" | ||||||
| * 5 - Verifica o se número de Keys é igual (0) assert | ||||||
| * fim | ||||||
| */ | ||||||
| cy.gui_deployKeyCreationName() | ||||||
| cy.gui_deployKeyCreation() | ||||||
| cy.gui_deleteKey() | ||||||
| }) | ||||||
| }) | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| -----BEGIN OPENSSH PRIVATE KEY----- | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deletar fixtures não utilizadas. |
||
| b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAACFwAAAAdzc2gtcn | ||
| NhAAAAAwEAAQAAAgEAqlL+eBorYyJKxGgymkjhpdG3oN2W0DNUlE5xkeHvvivYZK5grl+p | ||
| xlnAkaKJfTqGEkvtzOEoG0RHI3405UhSWcNDU1+UmHBfFi1Ag6yrKW9J1OjFPOMYEM3gWa | ||
| hNzj5g+jw96wNLSL0z4we0vdOnlkBJ3QSPUb9US+288JyejfmLNn9RfERkKBCQSNGq3J5y | ||
| gcTdPdSkoPr2TgEQ3XDowBQ3aRf9WnGyZfKrxv5/bOmoQxqdmx4+PjlMO6Pwlz77nShHWY | ||
| qKE3ZZ+t0QkQYDRADsLKN9ipZQSMlDz9WC33RMBCnGyVbNoj/yES8dJoJGWjFrIcr/s2iJ | ||
| SryZ2VhO2oOrmYNlnbbmZAqKKk8qkd4npjGO5H0yNnMhjc7kK9X3f9kbc5nbbmYuzgn20Z | ||
| XLR+xM/lJa04gr/Ss+mQlQVkhViSmMaK/5mMz+zWj+pEn74C9ZciI2x/jq2dMz8JSRTkGO | ||
| hLSiwajWpksbobjxSfUB2kw+xkUJo2z4eAAZ/2yzfzPpNeGsDAmSuTfurEGzRCg+j8X1nB | ||
| /+wJeiUKMUR0i8MaWeuGmftEieZTxMa9MD9v7QJM61mjy8Sf65HHwNs1Cwkal5ZI3izbOR | ||
| KADKuyN826yjgnQqEKZFqJYrXYbIo4Hs2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UbP3DxPEoB6kiuQKLV | ||
| rZ7mYdczF0EltH3B8QnJWMVu9HdkKtfSvBGcJtNATCZQNb49cmDcqs+lnP9LAY9l/g4WfM | ||
| HUaIxCqMCxNIVCMWgPEldTvGoueKgQcVPEkVveqFCGhgKsRgEfztdJd01FL/3/TYBMD+vg | ||
| M3DGYDmIL5yC9AywAAAQEAxMc6XXtNJxA2ypX6tqwz5U0bT9PWBaL4lapWSQmALf7HQ2HI | ||
| mtIaBB2Pllh277zQxv99uJ/47a8e+ANc70WHBHUHzmcCspuPIzS2e6UymfpdIBsYz4U7jZ | ||
| 9z+dqX47AqGvcLf/SZ3IsjyhUASmjYeYMrcVY1OE/iM5UPn7Z9JLBly+3P8hFODDsykNTX | ||
| h/GZtFmCm+u49RnaiZSB8aKPIJ9eBIt8Gjjd+01+wK51Ug3WBRm8nVUNY/zQrhi+TbDo78 | ||
| aQkkx7wilVRT9K3hfn1PW0HBVCn7MZpDwOQ9hJCy4sRSo6NzdptPtU7/RbFPjc92qx1SG1 | ||
| 4O3qVqr4ha/5jQAAABVzZXUtZW1haWxAZXhhbXBsZS5jb20BAgME | ||
| -----END OPENSSH PRIVATE KEY----- | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCqUv54GitjIkrEaDKaSOGl0beg3ZbQM1SUTnGR4e++K9hkrmCuX6nGWcCRool9OoYSS+3M4SgbREcjfjTlSFJZw0NTX5SYcF8WLUCDrKspb0nU6MU84xgQzeBZqE3OPmD6PD3rA0tIvTPjB7S906eWQEndBI9Rv1RL7bzwnJ6N+Ys2f1F8RGQoEJBI0arcnnKBxN091KSg+vZOARDdcOjAFDdpF/1acbJl8qvG/n9s6ahDGp2bHj4+OUw7o/CXPvudKEdZiooTdln63RCRBgNEAOwso32KllBIyUPP1YLfdEwEKcbJVs2iP/IRLx0mgkZaMWshyv+zaIlKvJnZWE7ag6uZg2WdtuZkCooqTyqR3iemMY7kfTI2cyGNzuQr1fd/2RtzmdtuZi7OCfbRlctH7Ez+UlrTiCv9Kz6ZCVBWSFWJKYxor/mYzP7NaP6kSfvgL1lyIjbH+OrZ0zPwlJFOQY6EtKLBqNamSxuhuPFJ9QHaTD7GRQmjbPh4ABn/bLN/M+k14awMCZK5N+6sQbNEKD6PxfWcH/7Al6JQoxRHSLwxpZ64aZ+0SJ5lPExr0wP2/tAkzrWaPLxJ/rkcfA2zULCRqXlkjeLNs5EoAMq7I3zbrKOCdCoQpkWolitdhsijgezYAdxv7t4syewoM0f8xyD/F4SQjO5BJQ7n+dEizw== seu-email@example.com |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -281,3 +281,23 @@ Cypress.Commands.add('assertStatus', statusText => { | |||||
| .should('contain', statusText) | ||||||
| cy.get('.qa-user-avatar').click() | ||||||
| }) | ||||||
| // CRUD | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remover comentário e adicionar uma linha em branco para seguir a consistência. |
||||||
| Cypress.Commands.add('gui_deployKeyCreationName', (name = faker.string.uuid()) => { | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Os comandos |
||||||
| cy.visit('http://localhost/admin/deploy_keys/new') | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A |
||||||
| cy.get('#deploy_key_title').type(name) | ||||||
| }) | ||||||
|
|
||||||
| Cypress.Commands.add('gui_deployKeyCreation',() => { | ||||||
| const publicKey = 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIF55ZxNcdW524Ob/y6kFkYu92DjTi2bqLkz37AFgFpZ+ root@example.com' | ||||||
| cy.get('#deploy_key_key').type(publicKey) | ||||||
| cy.get('.btn-success').click() | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Após a criação da key, gostaria de uma verificação de que a mesma foi criada. Algo como o seguinte:
|
||||||
|
|
||||||
| }) | ||||||
| Cypress.Commands.add('gui_deleteKey', () => { | ||||||
| cy.get('.page-title') | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Que tal assim?
|
||||||
| .should('contain', '1') | ||||||
| cy.get('.btn-remove').click() | ||||||
| cy.get('.page-title') | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aqui também
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Além disso, seria interessante verificar que a tabela de keys não existe mais. Definir um |
||||||
| .should('contain', '0') | ||||||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verificações de resultados esperados não devem (de preferências) ser abstraídos para custom commands. |
||||||
| }) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Por qual motivo você adicionou essa nova linha em branco? Favor removê-la.