Skip to content

Commit ee4301d

Browse files
authored
Merge pull request #452 from sensebox/test/navigation
test: add navigation test case
2 parents 2a7fb11 + d846a76 commit ee4301d

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

cypress/e2e/blockly.cy.js

+27-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,33 @@ describe("Blockly Editor Page Tests", () => {
2525
cy.visit("/user/login");
2626
});
2727

28-
/// <reference types="cypress" />
28+
it("[Blockly] navigates to tutorial and back", () => {
29+
cy.visit("/");
30+
cy.get('img[alt="Sensebox ESP"]').click();
31+
32+
// get a button that has an SVG with the class "fa-bars" inside it
33+
// this is the button that opens the menu
34+
const menuButton = cy.get("button").find("svg.fa-bars").parents("button");
35+
36+
// click the button
37+
menuButton.click();
38+
39+
// click the a with href "/tutorial"
40+
cy.get('a[href="/tutorial"]').click();
41+
cy.wait(1000);
42+
cy.url().should("include", "/tutorial");
43+
cy.wait(1000);
44+
45+
// click the button
46+
menuButton.click();
47+
48+
// click the a with href "/" and deep inside it an span containing "Blockly"
49+
cy.get('a[href="/"]').find("span").contains("Blockly").parents("a").click();
50+
cy.wait(1000);
51+
cy.url().should("include", "/");
52+
53+
cy.get('img[alt="Sensebox ESP"]').should("exist");
54+
});
2955

3056
it("[Blockly] selects senseBox ESP", () => {
3157
cy.visit("/");

0 commit comments

Comments
 (0)