Fix potentially flaky E2E test Closes #1326

This commit is contained in:
Kalle 2023-04-09 00:01:48 +03:00
parent 579d99c719
commit da74b9c2f7
2 changed files with 11 additions and 3 deletions

View File

@ -965,6 +965,7 @@ function APCompare({
className={clsx("justify-self-end", {
invisible: !ap,
})}
data-testid="ap-compare-1"
>
{ap}
{t("analyzer:abilityPoints.short")}
@ -982,7 +983,10 @@ function APCompare({
})}
style={{ width: `${ap2}px` }}
/>
<div className={clsx({ invisible: !ap2 })}>
<div
className={clsx({ invisible: !ap2 })}
data-testid="ap-compare-2"
>
{ap2}
{t("analyzer:abilityPoints.short")}
</div>

View File

@ -70,8 +70,12 @@ test.describe("Build Analyzer", () => {
await swimSpeedAbilityButtonLocator.click();
await page.getByTestId("ap-tab").click();
await page.getByText("10AP").isVisible();
await page.getByText("13AP").isVisible();
await expect(page.getByTestId("ap-compare-1").first()).toContainText(
"10AP"
);
await expect(page.getByTestId("ap-compare-2").first()).toContainText(
"13AP"
);
await page.getByTestId("swim-speed").getByText("BUILD 2").isVisible();
});