Open jadudm opened 3 weeks ago
Below is my implementation to handle this piece with the E2E testing.
When we expect it to succeed:
cy.request({
method: 'GET',
url: '/dissemination/report/pdf/' + reportId
}).should((response) => {
expect(response.isOkStatusCode).to.equal(true);
});
When we expect it to fail (Tribal and NOT public):
cy.request({
method: 'GET',
url: '/dissemination/report/pdf/' + reportId,
failOnStatusCode: false,
}).should((response) => {
expect(response.isOkStatusCode).to.equal(false);
});
This has been applied to the new dissemination-table-via-pdf.js
file.
Background
The E2E tests:
This works because the API points at the
dissemination
tables directly (infac-db
).With the move of the API to
fac-snapshot-db
, we can no longer use the API to check that a submission is complete. The API now points at a database that is refreshed nightly. Therefore, we need to rework the Cypress tests.Possible design
GET
. This would be a good first check, which can easily be worked back into the existing E2E framework.fac-db
tofac-snapshot-db
The test would have to now pull the
general
record(s), look atis_public
, and then check to make sure that the tables that should be suppressed are suppressed. In the E2E framwork, we knew the report ID (because it was all one test). Once it is broken up, we won't know the most recent submission. (We will be able to ask for thegeneral
submissions that came in today, which should exist if everything worked.)Tasks