001_install_mysql.spec.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. it('should login to control panel', () => {
  27. cy.actionStart();
  28. cy.get('.form-signin input[type=email]').should('have.length', 1);
  29. cy.get('.form-signin input[type=password]').should('have.length', 1);
  30. cy.get('.form-signin button').should('have.length', 1);
  31. cy.get('.form-signin input[name=email]').type('example@example.com');
  32. cy.get('.form-signin input[name=password]').type('example@example.com');
  33. cy.get('.form-signin button').click();
  34. cy.actionWait();
  35. cy.logoutCMS();
  36. });
  37. });