001_install_mysql.spec.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /// <reference types="Cypress" />
  2. context('Install MySQL, create first user and login', () => {
  3. it('should do redirect to cp panel', () => {
  4. cy.resetCMS();
  5. cy.request({
  6. url: cy.getBaseUrl() + '/',
  7. followRedirect: false
  8. }).then((response) => {
  9. expect(response.status).to.eq(302);
  10. expect(response.redirectedToUrl).to.eq(cy.getBaseUrl() + '/cp/');
  11. });
  12. cy.visitCMS('/cp/');
  13. cy.url().should('eq', cy.getBaseUrl() + '/cp/');
  14. });
  15. it('should configure mysql config', () => {
  16. cy.actionStart();
  17. cy.get('.form-signin input[type=text]').should('have.length', 4);
  18. cy.get('.form-signin input[type=password]').should('have.length', 1);
  19. cy.get('.form-signin button').should('have.length', 1);
  20. cy.get('.form-signin input[name=name]').type('fave');
  21. cy.get('.form-signin input[name=user]').type('root');
  22. cy.get('.form-signin input[name=password]').type('root');
  23. cy.get('.form-signin button').click();
  24. cy.actionWait();
  25. });
  26. xit('should create first user', () => {
  27. cy.actionStart();
  28. cy.get('.form-signin input[type=text]').should('have.length', 2);
  29. cy.get('.form-signin input[type=email]').should('have.length', 1);
  30. cy.get('.form-signin input[type=password]').should('have.length', 1);
  31. cy.get('.form-signin button').should('have.length', 1);
  32. cy.get('.form-signin input[name=first_name]').type('First');
  33. cy.get('.form-signin input[name=last_name]').type('Last');
  34. cy.get('.form-signin input[name=email]').type('example@example.com');
  35. cy.get('.form-signin input[name=password]').type('example@example.com');
  36. cy.get('.form-signin button').click();
  37. cy.actionWait();
  38. });
  39. it('should login to control panel', () => {
  40. cy.actionStart();
  41. cy.get('.form-signin input[type=email]').should('have.length', 1);
  42. cy.get('.form-signin input[type=password]').should('have.length', 1);
  43. cy.get('.form-signin button').should('have.length', 1);
  44. cy.get('.form-signin input[name=email]').type('example@example.com');
  45. cy.get('.form-signin input[name=password]').type('example@example.com');
  46. cy.get('.form-signin button').click();
  47. cy.actionWait();
  48. cy.logoutCMS();
  49. });
  50. });