mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add response check to submit login e2e test step
This commit is contained in:
parent
aeb2ce35d5
commit
b91bf38f1b
@ -16,17 +16,20 @@ When("the user submits no credentials", () => {
|
|||||||
When(
|
When(
|
||||||
"the user submits the credentials {string} {string}",
|
"the user submits the credentials {string} {string}",
|
||||||
(email: string, password: string) => {
|
(email: string, password: string) => {
|
||||||
cy.intercept("POST", "/graphql").as("login");
|
cy.intercept("POST", "/graphql", (req) => {
|
||||||
// cy.intercept('POST', '/graphql', (req) => {
|
if (
|
||||||
// if (req.body.hasOwnProperty('query') && req.body.query.includes('mutation')) {
|
req.body.hasOwnProperty("query") &&
|
||||||
// req.alias = 'login'
|
req.body.query.includes("mutation")
|
||||||
// }
|
) {
|
||||||
// });
|
req.alias = "login";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
loginPage.enterEmail(email);
|
loginPage.enterEmail(email);
|
||||||
loginPage.enterPassword(password);
|
loginPage.enterPassword(password);
|
||||||
loginPage.submitLogin();
|
loginPage.submitLogin();
|
||||||
cy.wait("@login").then((interception) => {
|
cy.wait("@login").then((interception) => {
|
||||||
|
expect(interception.response.statusCode).equals(200);
|
||||||
expect(JSON.stringify(interception.response.body)).contains(email);
|
expect(JSON.stringify(interception.response.body)).contains(email);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user