1 - Create Openstack Endpoint.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 Openstack Endpoint', () => {
  17. before(() => {
  18. cy.login()
  19. })
  20. beforeEach(() => {
  21. Cypress.Cookies.preserveOnce('token', 'projectId')
  22. })
  23. it('Shows new Openstack endpoint dialog', () => {
  24. cy.get('div').contains('New').click()
  25. cy.get('a').contains('Endpoint').click()
  26. cy.get('div[data-test-id="cProvider-endpointLogo-openstack"]').click()
  27. })
  28. it('Fills Openstack connection info', () => {
  29. cy.get('div').contains('Advanced').click()
  30. cy.get('input[placeholder="Name"]').type('e2e-openstack-test')
  31. cy.get('input[placeholder="Username"]').type(config.endpoints.openstack.username)
  32. cy.get('input[placeholder="Password"]').type(config.endpoints.openstack.password)
  33. cy.get('input[placeholder="Auth URL"]').type(config.endpoints.openstack.authUrl)
  34. cy.get('input[placeholder="Project Name"]').type(config.endpoints.openstack.projectName)
  35. cy.get('div[data-test-id="endpointField-dropdown-glance_api_version"]').first().click()
  36. cy.get('div[data-test-id="dropdownListItem"]').contains('2').click()
  37. cy.get('div[data-test-id="endpointField-dropdown-identity_api_version"]').first().click()
  38. cy.get('div[data-test-id="dropdownListItem"]').contains('3').click()
  39. cy.get('input[placeholder="Project Domain Name"]').type(config.endpoints.openstack.projectDomainName)
  40. cy.get('input[placeholder="User Domain Name"]').type(config.endpoints.openstack.userDomainName)
  41. cy.server()
  42. cy.route({ url: '**/actions', method: 'POST' }).as('validate')
  43. cy.get('button').contains('Validate and save').click()
  44. cy.wait('@validate')
  45. cy.get('div[data-test-id="endpointStatus"]').should('contain', 'Endpoint is Valid')
  46. })
  47. it('Added Openstack to endpoint list', () => {
  48. cy.visit(`${config.nodeServer}endpoints/`)
  49. cy.get('div[data-test-id="endpointListItem-content-e2e-openstack-test"]').should('contain', 'e2e-openstack-test')
  50. })
  51. })