Skip to content

Commit

Permalink
Create a tetris game to drive site engagement
Browse files Browse the repository at this point in the history
-Integrate Tetris game implementation

- Resolves #<ISSUE-NUMBER>
  • Loading branch information
Jordan-Mesches committed Nov 9, 2023
1 parent eb704d4 commit 8ef01b0
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 1 deletion.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
2 changes: 1 addition & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@ nav:
- exercises/03.automate.release/02.md
- ✨ Recap:
- exercises/recap/index.md
- Tetris Game: tetris.game/index.html
- Tetris Game: tetris.game/index.html
26 changes: 26 additions & 0 deletions tests/tetris.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { test, expect } from "@playwright/test";

test("Tetris Game", async ({ page }) => {
const { TETRIS_APP_HOST, TETRIS_APP_PORT, TETRIS_APP_PATH } = process.env;

// should be similar to http://127.0.0.1:8080/github-devsecops-fundamentals/
console.log(
`http://${TETRIS_APP_HOST}:${TETRIS_APP_PORT}/${TETRIS_APP_PATH}`
);
await page.goto(
`http://${TETRIS_APP_HOST}:${TETRIS_APP_PORT}/${TETRIS_APP_PATH}`
);

await page.getByRole("link", { name: "Tetris Game" }).click();
await expect(page.getByText("score 00000")).toBeVisible();
await expect(page.getByText("rows 0")).toBeVisible();
await expect(page.locator("#upcoming")).toBeVisible();
await expect(
page.getByRole("link", { name: "Press Space to Play." })
).toBeVisible();

await page.getByRole("link", { name: "Press Space to Play." }).click();
await expect(page.getByText("score 00000")).not.toBeVisible({
timeout: 0.5 * 60 * 1000,
});
});

0 comments on commit 8ef01b0

Please sign in to comment.