discourse.cy.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright Broadcom, Inc. All Rights Reserved.
  3. * SPDX-License-Identifier: APACHE-2.0
  4. */
  5. /// <reference types="cypress" />
  6. import { random } from '../support/utils';
  7. it('allows to sign up', () => {
  8. cy.visit('/');
  9. cy.contains('button', 'Sign Up').click();
  10. cy.fixture('users').then((user) => {
  11. cy.get('#new-account-email').type(`${random}.${user.newUser.email}`);
  12. cy.get('#new-account-username').type(`${random}.${user.newUser.username}`);
  13. cy.get('#new-account-password').type(`${random}.${user.newUser.password}`);
  14. });
  15. cy.contains('Checking username').should('not.exist');
  16. cy.get('.btn-large').contains('button', 'Sign Up').click();
  17. cy.contains('button', 'Resend Activation Email');
  18. });
  19. it('allows to create a topic', () => {
  20. cy.login();
  21. cy.contains('button', 'New Topic').click();
  22. cy.fixture('topics').then((topic) => {
  23. cy.get('#reply-title').type(`${topic.newTopic.title}-${random}`);
  24. cy.get('div[contenteditable="true"]').type(`${topic.newTopic.content} ${random}`);
  25. cy.contains('button', 'Create Topic').click();
  26. cy.contains('Saving').should('not.exist');
  27. cy.visit('/latest');
  28. cy.get('.topic-list').within(() => {
  29. cy.contains('td', `${topic.newTopic.title}-${random}`);
  30. });
  31. });
  32. });