Cypress evaluator action for Tryber projects
This action evaluate Tryber projects with Cypress library.
WARNING: the image docker version specified in the action.yml must be the same as the last evaluator release version
-
npm-startDefault: false
Run npm start and waits to http://localhost:3000 before testing.
-
headlessDefault: true
Hide the browser instead of running headed at Cypress running.
-
browserDefault: "chrome"
Define what browser Cypress must run.
-
pr_author_usernameRequired
Pull Request author username.
-
json-serverDefault: false
Initiate json-server start script before testing.
-
json-server-portDefault: 3050
Define json-server port.
-
json-server-dbDefault: ./server/db.json
Define json-server db file.
-
json-server-routesDefault: ./server/routes.json
Define json-server routes file.
-
resultCypress unit tests JSON results in base64 format.
uses: betrybe/cypress-evaluator-action@v8.2
with:
pr_author_username: ${{ github.event.inputs.pr_author_username }}- name: Cypress evaluator
id: evaluator
uses: betrybe/cypress-evaluator-action@v8.2
with:
pr_author_username: ${{ github.event.inputs.pr_author_username }}
- name: Next step
uses: another-github-action
with:
param: ${{ steps.evaluator.outputs.result }}The project that wants to use this action should implement unit tests grouping them using describe statements.
Each describe statement will be mapped to a requirement.
Example:
describe('requirement #1' () => {
it('unit test1', () => {});
it('unit test2', () => {});
it('unit test3', () => {});
});
describe('requirement #2' () => {
it('unit test1', () => {});
it('unit test2', () => {});
it('unit test3', () => {});
});
describe('requirement #3' () => {
it('unit test1', () => {});
it('unit test2', () => {});
it('unit test3', () => {});
});Project repository must create a file called requirements.json inside .trybe folder.
This file should have the following structure:
{
"requirements": [{
"description": "requirement #1",
"bonus": false
}, {
"description": "requirement #2",
"bonus": true
}, {
"description": "requirement #3",
"bonus": false
}]
}where the "requirement #1", "requirement #2" and "requirement #3" are the requirements and describes names.