|
1 | | -describe("PixiJS Game E2E", () => { |
2 | | - beforeEach(() => { |
| 1 | +describe("App E2E", () => { |
| 2 | + it("renders the app container", () => { |
3 | 3 | cy.visit("/"); |
4 | | - }); |
5 | | - |
6 | | - describe("Initial Page Load", () => { |
7 | | - it("should display the game page correctly", () => { |
8 | | - // Check page title |
9 | | - cy.title().should("eq", "Vite + React + TS"); |
10 | | - |
11 | | - // Check main heading |
12 | | - cy.get("h1").should("contain.text", "PixiJS React Game"); |
13 | | - |
14 | | - // Check instructions are present |
15 | | - cy.get("p.instructions").should( |
16 | | - "contain.text", |
17 | | - "A minimal PixiJS game built with @pixi/react" |
18 | | - ); |
19 | | - |
20 | | - // Check that the game container exists |
21 | | - cy.get(".app-container").should("be.visible"); |
22 | | - }); |
23 | | - |
24 | | - it("should have proper page structure", () => { |
25 | | - // Check main container |
26 | | - cy.get(".app-container").should("exist").and("be.visible"); |
27 | | - |
28 | | - // Check heading structure |
29 | | - cy.get("h1").should("have.length", 1); |
30 | | - |
31 | | - // Check instructions |
32 | | - cy.get("p.instructions").should("be.visible"); |
33 | | - }); |
34 | | - }); |
35 | | - |
36 | | - describe("Game Canvas", () => { |
37 | | - it("should render the PixiJS canvas", () => { |
38 | | - // PixiJS creates a canvas element |
39 | | - cy.get("canvas").should("exist"); |
40 | | - }); |
41 | | - |
42 | | - it("should have the correct canvas dimensions", () => { |
43 | | - // Check that canvas has the expected dimensions (800x600) |
44 | | - cy.get("canvas").should(($canvas) => { |
45 | | - expect($canvas[0]).to.have.property("width", 800); |
46 | | - expect($canvas[0]).to.have.property("height", 600); |
47 | | - }); |
48 | | - }); |
49 | | - }); |
50 | | - |
51 | | - describe("Game Interaction", () => { |
52 | | - it("should be interactive", () => { |
53 | | - // Wait for canvas to be ready |
54 | | - cy.get("canvas").should("be.visible"); |
55 | | - |
56 | | - // The game canvas should be present and ready for interaction |
57 | | - cy.get("canvas").should("have.attr", "style"); |
58 | | - }); |
59 | | - }); |
60 | | - |
61 | | - describe("Accessibility", () => { |
62 | | - it("should have proper heading structure", () => { |
63 | | - cy.get("h1").should("have.length", 1); |
64 | | - }); |
65 | | - |
66 | | - it("should have readable content", () => { |
67 | | - cy.get("h1") |
68 | | - .should("be.visible") |
69 | | - .and("contain.text", "PixiJS React Game"); |
70 | | - cy.get("p.instructions").should("be.visible"); |
71 | | - }); |
72 | | - }); |
73 | | - |
74 | | - describe("Responsive Design", () => { |
75 | | - it("should be visible on different screen sizes", () => { |
76 | | - // Test on tablet size |
77 | | - cy.viewport(768, 1024); |
78 | | - cy.get(".app-container").should("be.visible"); |
79 | | - cy.get("canvas").should("be.visible"); |
80 | | - |
81 | | - // Test on mobile size |
82 | | - cy.viewport(375, 667); |
83 | | - cy.get(".app-container").should("be.visible"); |
84 | | - }); |
| 4 | + cy.get("[data-testid=app-container]").should("exist"); |
85 | 5 | }); |
86 | 6 | }); |
0 commit comments