001_install_mysql.spec.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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.visit('http://localhost:8080/');
  6. cy.url().should('eq', 'http://localhost:8080/cp/');
  7. });
  8. it('should configure mysql config', () => {
  9. cy.actionStart();
  10. cy.get('.form-signin input[type=text]').should('have.length', 4);
  11. cy.get('.form-signin input[type=password]').should('have.length', 1);
  12. cy.get('.form-signin button').should('have.length', 1);
  13. cy.get('.form-signin input[name=name]').type('fave');
  14. cy.get('.form-signin input[name=user]').type('root');
  15. cy.get('.form-signin input[name=password]').type('root');
  16. cy.get('.form-signin button').click();
  17. cy.actionWait();
  18. });
  19. it('should create first user', () => {
  20. cy.actionStart();
  21. cy.get('.form-signin input[type=text]').should('have.length', 2);
  22. cy.get('.form-signin input[type=email]').should('have.length', 1);
  23. cy.get('.form-signin input[type=password]').should('have.length', 1);
  24. cy.get('.form-signin button').should('have.length', 1);
  25. cy.get('.form-signin input[name=first_name]').type('First');
  26. cy.get('.form-signin input[name=last_name]').type('Last');
  27. cy.get('.form-signin input[name=email]').type('example@example.com');
  28. cy.get('.form-signin input[name=password]').type('example@example.com');
  29. cy.get('.form-signin button').click();
  30. cy.actionWait();
  31. });
  32. it('should login to control panel', () => {
  33. cy.actionStart();
  34. cy.get('.form-signin input[type=email]').should('have.length', 1);
  35. cy.get('.form-signin input[type=password]').should('have.length', 1);
  36. cy.get('.form-signin button').should('have.length', 1);
  37. cy.get('.form-signin input[name=email]').type('example@example.com');
  38. cy.get('.form-signin input[name=password]').type('example@example.com');
  39. cy.get('.form-signin button').click();
  40. cy.actionWait();
  41. cy.logoutCMS();
  42. });
  43. });