Skip to content

Commit 2ca913e

Browse files
authored
Merge pull request #426 from sensebox/development
Release 2.2.0
2 parents 9f6a4f2 + f8c98b2 commit 2ca913e

File tree

145 files changed

+16069
-22532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+16069
-22532
lines changed

.env

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
REACT_APP_INITIAL_COMPILER_URL=https://compiler.sensebox.de
1+
VITE_INITIAL_COMPILER_URL=https://compiler.sensebox.de
22

3-
REACT_APP_BOARD=sensebox-mcu
4-
REACT_APP_BLOCKLY_API=https://api.blockly.sensebox.de
3+
VITE_BOARD=sensebox-mcu
4+
VITE_BLOCKLY_API=https://api.blockly.sensebox.de
55

66
GENERATE_SOURCEMAP=false
77

88
# in days
9-
REACT_APP_SHARE_LINK_EXPIRES=30
9+
VITE_SHARE_LINK_EXPIRES=30

.github/workflows/e2e.yml

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
name: Cypress Tests
22

33
on:
4-
push:
5-
branches: [main]
6-
tags: ['v*.*.*']
7-
pull_request:
8-
branches:
9-
- main
10-
workflow_dispatch:
11-
4+
push:
5+
branches: [main, development]
6+
tags: ["v*.*.*"]
7+
pull_request:
8+
branches:
9+
- main
10+
- development
11+
workflow_dispatch:
12+
1213
jobs:
1314
cypress-run:
1415
runs-on: ubuntu-latest
@@ -21,4 +22,13 @@ jobs:
2122
uses: cypress-io/github-action@v6
2223
with:
2324
build: npm run build
24-
start: npx --yes serve -s build -l 3000
25+
start: npx --yes serve -s build -l 3000
26+
- name: Run CTRF annotations
27+
if: always()
28+
uses: ctrf-io/github-test-reporter@v1
29+
with:
30+
report-path: "./ctrf/*.json"
31+
test-report: true
32+
pull-request: true
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,6 @@ npm-debug.log*
2222
yarn-debug.log*
2323
yarn-error.log*
2424

25+
crtf/*
26+
cypress/downloads/*
27+
yarn.lock

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true
4+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ A modern, React-based version of the [senseBox](https://sensebox.de) Ardublockly
6969
The compiler URL can be configured in the `.env` file:
7070

7171
```
72-
REACT_APP_COMPILER_URL=https://compiler.sensebox.de
72+
VITE_COMPILER_URL=https://compiler.sensebox.de
7373
```
7474

7575
## 📝 Development Guidelines

cypress.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
const { defineConfig } = require("cypress");
1+
import { defineConfig } from "cypress";
2+
import { GenerateCtrfReport } from "cypress-ctrf-json-reporter";
23

3-
module.exports = defineConfig({
4+
export default defineConfig({
45
e2e: {
56
setupNodeEvents(on, config) {
6-
// implement node event listeners here
7+
new GenerateCtrfReport({
8+
on,
9+
});
710
},
811
baseUrl: "http://localhost:3000",
912
},

cypress/e2e/blockly.cy.js

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,67 @@ describe("Blockly Editor Page Tests", () => {
55
cy.visit("/");
66
});
77

8-
it("[Blockly] selects senseBox ESP", () => {
8+
it("[Blockly] visits the tutorial page", () => {
9+
cy.visit("/tutorial");
10+
});
11+
12+
it("[Blockly] visits the gallery page", () => {
13+
cy.visit("/gallery");
14+
});
15+
16+
it("[Blockly] visits the faq page", () => {
17+
cy.visit("/faq");
18+
});
19+
20+
it("[Blockly] visits the settings page", () => {
21+
cy.visit("/settings");
22+
});
23+
24+
it("[Blockly] visits the login page", () => {
25+
cy.visit("/user/login");
26+
});
27+
28+
it("[Blockly] navigates to tutorial and back", () => {
929
cy.visit("/");
1030
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('button[aria-label="Compile code"]').should("exist");
54+
});
55+
56+
it("[Blockly] selects senseBox ESP", () => {
57+
cy.visit("/");
58+
cy.get('img[alt="Sensebox ESP"]', { timeout: 8000 }).click();
59+
});
60+
61+
it("[Blockly] selects senseBox MCU", () => {
62+
cy.visit("/");
63+
cy.get('img[alt="Sensebox MCU"]', { timeout: 8000 }).click();
64+
});
65+
66+
it("[Blockly] selects senseBox Mini", () => {
67+
cy.visit("/");
68+
cy.get('img[alt="Sensebox Mini"]', { timeout: 8000 }).click();
1169
});
1270

1371
it("[Blockly] compiles code", () => {
@@ -32,6 +90,5 @@ describe("Blockly Editor Page Tests", () => {
3290
expect(interception.response.body.data).to.have.property("id");
3391
expect(interception.response.body.data.id).to.be.a("string");
3492
});
35-
3693
});
3794
});

cypress/e2e/code-editor.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe("Code Editor Page Tests", () => {
1313
it("[CodeEditor] compiles code", () => {
1414
cy.visit("/codeeditor");
1515
cy.get('img[alt="Sensebox ESP"]').click();
16-
cy.get("button").contains("Kompilieren").click();
16+
cy.get("#compile").click();
1717
});
1818

1919
it("[CodeEditor] opens reset dialog", () => {

public/index.html renamed to index.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
5+
<link rel="icon" href="/favicon.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#4EAF47" />
8-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
8+
<link rel="apple-touch-icon" href="/logo192.png" />
99
<!--
1010
manifest.json provides metadata used when your web app is installed on a
1111
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1212
-->
13-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
13+
<link rel="manifest" href="/manifest.json" />
1414
<!--
1515
Notice the use of %PUBLIC_URL% in the tags above.
1616
It will be replaced with the URL of the `public` folder during the build.
@@ -25,6 +25,8 @@
2525
<body>
2626
<noscript>You need to enable JavaScript to run this app.</noscript>
2727
<div id="root"></div>
28+
<script type="module" src="/src/index.jsx"></script>
29+
2830
<!--
2931
This HTML file is a template.
3032
If you open it directly in the browser, you will see an empty page.

0 commit comments

Comments
 (0)