mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Revert "move response in e2e test to common step definitions"
This reverts commit d89fc1ef105366d0f9deffb0bf79869ce5dff019.
This commit is contained in:
parent
d89fc1ef10
commit
010e17ee62
@ -18,18 +18,6 @@ Given(
|
|||||||
|
|
||||||
Then("the user is logged in with username {string}", (username: string) => {
|
Then("the user is logged in with username {string}", (username: string) => {
|
||||||
const overviewPage = new OverviewPage();
|
const overviewPage = new OverviewPage();
|
||||||
cy.intercept("POST", "/graphql", (req) => {
|
|
||||||
if (
|
|
||||||
req.body.hasOwnProperty("query") &&
|
|
||||||
req.body.query.includes("mutation")
|
|
||||||
) {
|
|
||||||
req.alias = "login";
|
|
||||||
}
|
|
||||||
});
|
|
||||||
cy.wait("@login").then((interception) => {
|
|
||||||
expect(interception.response.statusCode).equals(200);
|
|
||||||
expect(JSON.stringify(interception.response.body)).contains(email);
|
|
||||||
});
|
|
||||||
cy.url().should("include", "/overview");
|
cy.url().should("include", "/overview");
|
||||||
cy.get(overviewPage.navbarName).should("contain", username);
|
cy.get(overviewPage.navbarName).should("contain", username);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -16,9 +16,22 @@ 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", (req) => {
|
||||||
|
if (
|
||||||
|
req.body.hasOwnProperty("query") &&
|
||||||
|
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) => {
|
||||||
|
expect(interception.response.statusCode).equals(200);
|
||||||
|
expect(JSON.stringify(interception.response.body)).contains(email);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user