Testing asking a question

We are going to implement a test on our app using Cypress; the test signs in and then asks a question. Carry out the following steps to do so:

  1. Let's create a new file called qanda.js in the integration folder in the cypress folder with the following content:
describe('Ask question', () => {  beforeEach(() => {    cy.visit('/');  });  it('When signed in and ask a valid question, the question should successfully save', () => {      });});

The describe function allows us to group a collection of tests on a feature. The first parameter is the title for the group, while the second parameter is a function that contains the tests in the group.

The it function allows us to define the actual test. The first parameter is the title ...

Get ASP.NET Core 3 and React now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.