-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes COE Console (Pull Request #225)
- Removes redundant CoE console - Adds developer documentation
Showing
10 changed files
with
149 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Development environment documentation | ||
## Required technologies and tools | ||
- [Node Package Manager (NPM)](https://www.npmjs.com/package/npm): a package management system used to maintain packages used by the application. NPM 3 or higher is required. | ||
- [Gulp](https://gulpjs.com/docs/en/getting-started/quick-start): a build system used to build the application. | ||
- [Electron](http://electron.atom.io/): The app is built with Electron v10.4.7. | ||
- [Node.js](https://nodejs.org/) (v14.x is required). | ||
- [Visual Studio Code](https://code.visualstudio.com/) is a good choice as an editor: it's cross-platform and is actually built on top of Electron. That said, everything can be used. | ||
|
||
To manage multiple versions of **`Node.js`** &/or **`npm`**, consider using a [node version manager](https://github.com/search?q=node+version+manager+archived%3Afalse&type=repositories&ref=advsearch). | ||
## How to build and run the application | ||
The following are the commands to run the application. After checking out the repo: | ||
1. To install node dependencies: `npm install` | ||
2. To install gulp: `npm install -g gulp` (it's easiest to have it installed globally) | ||
3. To build the UI: `gulp` or `gulp build` | ||
4. To run it: `npm start` | ||
5. To run tests: `npm test` | ||
6. To build and create a developer .exe file: `gulp package` | ||
|
||
## Useful commands and properties | ||
- `gulp watch`: it will automatically detect when you save a file and run the corresponding build task so you only have to refresh the app when developing. | ||
- `--no-sandbox`: the property `--no-sandbox` has been inserted to `npm start` to disable sandbox mode to prevent GPU mismanagement errors, caused by Electron conflicts, during virtualization on a Linux operating system. It is necessary, however, that this property be entered while starting the built program from the terminal. For example, starting the AppImage from the terminal we would type `./NomeAppImage --no-sandbox`. This way, the application will be started without any problems. | ||
|
||
## Latest builds | ||
The master branch is built automatically on git pushes and the output, for successful builds. Please find the artifacts by clicking in the run [of the Package workflow](https://github.com/INTO-CPS-Association/into-cps-application/actions?query=workflow%3APackage). | ||
|
||
These builds represent ongoing work. They have not been fully tested and are not guaranteed to work. Normally, you are advised to use one of the [releases](https://github.com/INTO-CPS-Association/into-cps-application/releases). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { TestHelper } from "./TestHelpers/Testhelper"; | ||
|
||
const helper = new TestHelper(); | ||
|
||
test.describe("COE Button Tests", async () => { | ||
test.beforeAll(async () => { | ||
await helper.launch(); | ||
}); | ||
|
||
test.afterAll(async () => { | ||
await helper.shutdown(); | ||
}); | ||
|
||
test('Initial state: Button should show "Start COE" with red circle', async () => { | ||
expect(await helper.window.locator('#coe-btn-launch-bottom') | ||
.innerText() | ||
).toMatch('Start COE'); | ||
|
||
expect(await helper.window.locator('#coeIconColor') | ||
.evaluate((span) => span.style.color) | ||
).toBe('red'); | ||
}); | ||
|
||
test('Clicking button: Should change to "Stop COE" with green circle', async () => { | ||
await helper.window.locator('#coe-btn-launch-bottom').click(); | ||
|
||
expect(await helper.window.locator('#coe-btn-launch-bottom') | ||
.innerText() | ||
).toMatch('Stop COE'); | ||
|
||
expect(await helper.window.locator('#coeIconColor') | ||
.evaluate((span) => span.style.color) | ||
).toBe('green'); | ||
}); | ||
|
||
test('Clicking "Stop COE": Should change back to "Start COE" with red circle', async () => { | ||
// First click to start COE | ||
await helper.window.locator('#coe-btn-launch-bottom').click(); | ||
expect(await helper.window.locator('#coe-btn-launch-bottom') | ||
.innerText() | ||
).toMatch('Stop COE'); | ||
|
||
expect (await helper.window.locator('#coeIconColor') | ||
.evaluate((span) => span.style.color) | ||
).toBe('green'); | ||
|
||
// Second click to stop COE | ||
await helper.window.locator('#coe-btn-launch-bottom').click(); | ||
await helper.window.waitForTimeout(2000); | ||
|
||
expect(await helper.window.locator('#coe-btn-launch-bottom') | ||
.innerText() | ||
).toMatch('Start COE'); | ||
|
||
expect (await helper.window.locator('#coeIconColor') | ||
.evaluate((span) => span.style.color) | ||
).toBe('red'); | ||
|
||
}); | ||
}); |