Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iyanfdezz committed Apr 24, 2024
1 parent 91c4ddc commit 7a67ba7
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 11 deletions.
26 changes: 21 additions & 5 deletions webapp/e2e/steps/create-group.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,31 @@ defineFeature(feature, (test) => {

await page.waitForSelector('[name="name"]');
await page.type('[name="name"]', "Test Group");
await page.click("button", { text: "Crear" });
await page.waitForTimeout(1000);
});
await page.waitForTimeout(2000);
await page.evaluate(() => {
var botones = document.querySelectorAll('button.chakra-button.css-r7xd4a[data-testid="addgroup-button"]');
botones.forEach(function(boton) {
if (boton.textContent === "Crear") {
boton.click();
}
});
});
});

then("The Group should be shown on the My Groups page", async () => {
await page.waitForTimeout(1000);
await page.click('button[aria-label="Abrir menú"]');
await page.click('[data-testid="home-misgrupos-link"]');
await page.waitForTimeout(1000);
await page.evaluate(() => {
var enlaces = document.querySelectorAll('a.chakra-link.css-spn4bz[data-testid="home-misgrupos-link"]');
enlaces.forEach(function(enlace) {
if (enlace.textContent === "Mis grupos") {
enlace.click();
}
});
});
//await page.waitForNavigation({ waitUntil: "networkidle0" });

await page.waitForTimeout(2000);
const groupExists = await page.evaluate(() => {
const groupName = "Test Group";
const groups = Array.from(document.querySelectorAll("tbody tr td:first-child"));
Expand Down
4 changes: 2 additions & 2 deletions webapp/e2e/steps/logout.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defineFeature(feature, (test) => {
await page.waitForSelector("#login-password");
await page.type("#login-password", password);
await page.click("button", { text: "Login" });
await page.waitForNavigation({ waitUntil: "networkidle0" });
//await page.waitForNavigation({ waitUntil: "networkidle0" });
});

when("I click on the Logout link", async () => {
Expand All @@ -44,7 +44,7 @@ defineFeature(feature, (test) => {
await page.click('button[aria-label="Abrir menú"]');
await page.waitForSelector('[data-testid="home-logout-link"]');
await page.click('[data-testid="home-logout-link"]');
await page.waitForNavigation({ waitUntil: "networkidle0" });
//await page.waitForNavigation({ waitUntil: "networkidle0" });
});

then("The user should be logged out and the Login screen should be shown", async () => {
Expand Down
2 changes: 1 addition & 1 deletion webapp/e2e/steps/register-form.steps.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defineFeature(feature, (test) => {
});

when("I fill the data in the form and press submit", async () => {
username = "testuser";
username = "papapa";
password = "Testpassword1";
await page.waitForSelector('#register-username');
await page.type('#register-username', username);
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/Nav/Nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ const Nav = () => {
<Link href="/social/grupos" data-testid="home-grupos-link">
{t("components.nav.groups")}
</Link>
<Link href="/social/misgrupos" data-testid="home-misgrupos-link">
<Link href="/social/misgrupos" data-testid="home-mygroups-link">
{t("components.nav.usergroups")}
</Link>
<Link href="/stats" data-testid="home-stats-link">{t("components.nav.stats")}</Link>
Expand All @@ -329,7 +329,7 @@ const Nav = () => {
<Box>
<Flex flexDirection={"column"}>
<Link href="/config" data-testid="home-config-link">
{t("components.nav.config")}
{t("components.nav.options")}
</Link>
<Link href="/sobre" data-testid="home-sobre-link">
{t("components.nav.about")}
Expand Down
1 change: 1 addition & 0 deletions webapp/src/pages/Bateria/Bateria.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ const JuegoPreguntas = () => {
padding={"1rem"}
height={"fit-content"}
minHeight={"3rem"}
data-testid={`answer-button-${index}`}
>
{respuesta}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/pages/Social/Groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ const Groups = () => {
onChange={(e) => setName(e.target.value)}
/>
</InputGroup>
<Button colorScheme="blue" onClick={addGroup}>
<Button colorScheme="blue" onClick={addGroup} data-testid="addgroup-button">
{t("pages.groups.create")}
</Button>
</Box>
Expand Down

0 comments on commit 7a67ba7

Please sign in to comment.