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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.