Create OCI Endpoint.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. Copyright (C) 2018 Cloudbase Solutions SRL
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. // @flow
  15. import config from '../../config'
  16. describe('Create OCI Endpoint', () => {
  17. before(() => {
  18. cy.login()
  19. })
  20. beforeEach(() => {
  21. Cypress.Cookies.preserveOnce('token', 'projectId')
  22. })
  23. it('Shows new OCI endpoint dialog', () => {
  24. cy.get('div').contains('New').click()
  25. cy.getById('newItemDropdown-listItem-Endpoint').click()
  26. cy.getById('cProvider-endpointLogo-oci').click()
  27. })
  28. it('Fills OCI connection info', () => {
  29. cy.getById('endpointField-textInput-name', 'input').type('e2e-oci-test')
  30. cy.getById('endpointField-textArea-private_key_data', 'textarea')
  31. .type(config.endpoints.oci.privateKeyData, { delay: 0 })
  32. cy.getById('endpointField-textInput-region', 'input').type(config.endpoints.oci.region)
  33. cy.getById('endpointField-textInput-tenancy', 'input').type(config.endpoints.oci.tenancy)
  34. cy.getById('endpointField-textInput-user', 'input').type(config.endpoints.oci.user)
  35. cy.getById('endpointField-textInput-private_key_passphrase', 'input').type(config.endpoints.oci.privateKeyPassphrase)
  36. cy.server()
  37. cy.route({ url: '**/actions', method: 'POST' }).as('validate')
  38. cy.get('button').contains('Validate and save').click()
  39. cy.wait('@validate')
  40. cy.getById('endpointStatus').should('contain', 'Endpoint is Valid')
  41. })
  42. it('Added Endpoint to endpoint list', () => {
  43. cy.getById('navigation-smallMenuItem-endpoints').click()
  44. cy.getById('endpointListItem-content-e2e-oci-test').should('contain', 'e2e-oci-test')
  45. })
  46. })