zupit / beagle-web-components Goto Github PK
View Code? Open in Web Editor NEWProject: Produto - Beagle
License: Apache License 2.0
Project: Produto - Beagle
License: Apache License 2.0
Some features can be optimized to avoid unnecessary browser restarting, improving test speed.
Refer to Beagle's mobile tests feature for reference
For some reason, the ci button test behaves differently from the locally run test. Apparently when the test was run it couldn't find the buttons that are disabled on the screen
Running: ButtonScreen.feature (3 of 17)
Button Component Validation
1) Button 01 - Button component renders text attribute correctly
✓ Button 02 - Button component renders action attribute correctly (example #1) (515ms)
✓ Button 02 - Button component renders action attribute correctly (example #2) (350ms)
✓ Button 02 - Button component renders action attribute correctly (example #3) (292ms)
✓ Button 02 - Button component renders action attribute correctly (example #4) (300ms)
4 passing (15s)
1 failing
1) Button Component Validation
Button 01 - Button component renders text attribute correctly:
AssertionError: Timed out retrying: expected '<button.design-system-button-screen-button>' to be 'disabled'
at eval (http://localhost:4200/__cypress/tests?p=cypress/integration/ButtonScreen.feature:665:90)
at resolveValue (http://localhost:4200/__cypress/tests?p=cypress/integration/ButtonScreen.feature:12987:20)
at Context.waitUntil (http://localhost:4200/__cypress/tests?p=cypress/integration/ButtonScreen.feature:12997:10)
(Results)
│ Tests: 5
│ Passing: 4
│ Failing: 1
│ Pending: 0
│ Skipped: 0
│ Screenshots: 1
│ Video: false
│ Duration: 14 seconds
│ Spec Ran: ButtonScreen.feature
We should create integrated tests for every component that we have.
Create test scripts for GitHub Actions. The scripts will test angular9 project using cypress.
According to the EPIC ZupIT/beagle#210 we need to improve futureListView to handle the new contract definition
Later, we will remove list view and keep only future list view, but for now, we will keep both.
The Image tests are now failing due to an update on the Image Builder class
It will be necessary to adjust the builder to show the broken images:
And to adjust the test:
Beagle Cypress Image tests would be more assertive if they use screenshot to validate the images and their style and position
EPIC for reference - ZupIT/beagle#422
You must refactor this component using new context features.
New PageView interface:
data class PageView(
val children: List<ServerDrivenComponent>,
override val context: ContextData? = null,
val onPageChange: List<Action>? = null,
val currentPage: Bind<Int>? = null
) : ServerDrivenComponent, ContextComponent
data class PageIndicator(
val selectedColor: String?,
val unselectedColor: String?,
var numberOfPages: Int?,
var currentPage: Bind<Int>?
) : ServerDrivenComponent
Review the cache strategy of Cypress CI tests, as some packages and dependencies are still being downloaded on every run
Support docs:
https://docs.github.com/en/actions/guides/caching-dependencies-to-speed-up-workflows
https://dev.to/mpocock1/how-to-cache-nodemodules-in-github-actions-with-yarn-24eh
https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
Analytics tests are failing on CI:
Analytics validation
✓ Analytics 01 - Action with no remote analytics config and not declared in the local config (should not create record) (2340ms)
1) Analytics 02 - Action with no remote analytics config and declared in the local config (should create record with params in config)
2) Analytics 03 - Action with remote analytics config and not declared in the local config (should create record with params from remote config)
✓ Analytics 04 - Action with analytics disabled in the remote config (should not create record) (419ms)
3) Analytics 05 - View loaded, screen analytics enabled in the config (should create record)
2 passing (37s)
3 failing
1) Analytics validation
Analytics 02 - Action with no remote analytics config and declared in the local config (should create record with params in config):
AssertionError: Timed out retrying after 10000ms: Expected to find content: '{"type":"screen","platform":"WEB Angular","timestamp":1612148400000,"screen":"analytics2"},{"type":"action","platform":"WEB Angular","event":"onPress","component":{"type":"beagle:button","id":"_beagle_5","xPath":"BODY/APP-ROOT[1]/BEAGLE[1]/BEAGLE-REMOTE-VIEW/BEAGLE-SCREEN[20]/BEAGLE-CONTAINER/DIV/BEAGLE-BUTTON[4]/","position":{"x":8,"y":26}},"beagleAction":"beagle:confirm","attributes":{"message":"Confirm Message"},"timestamp":1612148400000,"screen":"/analytics2"}' within the element: <div#analyticsCypress> but never did.
at Object.getAnalyticsInArray (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:103:84)
at AnalyticsPage.verifyIfAnalyticsIsCreated (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:684:38)
at Context.eval (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:1914:19)
at Context.resolveAndRunStepDefinition (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:13102:29)
at Context.eval (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:12446:35)
2) Analytics validation
Analytics 03 - Action with remote analytics config and not declared in the local config (should create record with params from remote config):
AssertionError: Timed out retrying after 10000ms: Expected to find content: '{"type":"screen","platform":"WEB Angular","timestamp":1612148400000,"screen":"analytics2"},{"type":"action","platform":"WEB Angular","event":"onPress","component":{"type":"beagle:button","id":"_beagle_6","xPath":"BODY/APP-ROOT[1]/BEAGLE[1]/BEAGLE-REMOTE-VIEW/BEAGLE-SCREEN[20]/BEAGLE-CONTAINER/DIV/BEAGLE-BUTTON[12]/","position":{"x":573.90625,"y":26}},"beagleAction":"beagle:alert","attributes":{"message":"AlertMessage"},"timestamp":1612148400000,"screen":"/analytics2"}' within the element: <div#analyticsCypress> but never did.
at Object.getAnalyticsInArray (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:103:84)
at AnalyticsPage.verifyIfAnalyticsIsCreated (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:684:38)
at Context.eval (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:1914:19)
at Context.resolveAndRunStepDefinition (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:13102:29)
at Context.eval (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:12446:35)
3) Analytics validation
Analytics 05 - View loaded, screen analytics enabled in the config (should create record):
AssertionError: Timed out retrying after 10000ms: Expected to find content: '{"type":"screen","platform":"WEB Angular","timestamp":1612148400000,"screen":"analytics2"}' within the element: <div#analyticsCypress> but never did.
at Object.getAnalyticsInArray (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:103:84)
at AnalyticsPage.verifyIfAnalyticsIsCreated (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:684:38)
at Context.eval (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:1914:19)
at Context.resolveAndRunStepDefinition (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:13102:29)
at Context.eval (http://localhost:4200/__cypress/tests?p=cypress/integration/AnalyticsScreen.feature:12446:35)
EPIC for reference - ZupIT/beagle#505
In the navigate test, in scenario 4 cypress is unable to click the "PopToView" button
PR: #28
We need to test cypress behavior on a screen with a lot of attributes that it should scroll to find the element
At the moment listview tests are failing because we were unable to run them in headless mode. For this to be possible, we need to define a fixed size for the viewport performed by the test.
The project located at automated-tests/common/ needs some refactoring such as:
The first draft of the refactoring was described here: https://github.com/ZupIT/beagle-web-components/blob/85366ae4cbd83598a749d9184e04c0a7442e9775/automated-tests/common/cypress/support/steps/generic-step.ts
We need to test cypress behavior on a screen with a lot of attributes that it should scroll to find the element
Create a GitHub action to run the tests on Angular 9 on a Schedule.
The beagle-web-core and beagle-angular versions should be download directly from their respective master branches.
If the test fails an e-mail should be sent to every CODEOWNER. Please review the CODEOWNERS file.
This action should also be triggered before releasing a version of beagle web core or beagle-angular. But I dont't even know if this is possible.
Failing tests: https://github.com/ZupIT/beagle-web-components/runs/3106771344?check_suite_focus=true
Locally all tests are passing
Running angular9 tests (command yarn test:angular:9) showed that some scenarios are failing.
tests doc: https://github.com/ZupIT/beagle-web-components#tests-1
yarn run v1.22.10
$ cypress-tags run --browser chrome --headless --env baseUrl=http://localhost:4200
Using cypress.json configuration:
Spec files: cypress/integration/**/*.feature
Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
====================================================================================================
(Run Starting)
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ Cypress: 6.0.0 │
│ Browser: Chrome 88 (headless) │
│ Specs: 17 found (AddChildrenScreen.feature, AlertScreen.feature, ButtonScreen.feature, Co │
│ nditionalScreen.feature, Confirm.feature, ConfirmScreen.feature, ContainerScreen.f │
│ eature, ImageScreen.feature, ListViewScreen.feature, NavigateScreen.feature, PageV │
│ iewScreen.f...) │
│ Searched: cypress\integration\AddChildrenScreen.feature, cypress\integration\AlertScreen.fea │
│ ture, cypress\integration\ButtonScreen.feature, cypress\integration\ConditionalScr │
│ een.feature, cypress\integration\Confirm.feature, cypress\integration\ConfirmScree │
│ n.feature, cypress\integration\ContainerScreen.feature, cypress\integration\ImageS │
│ creen.feature, cypress\integration\ListViewScreen.feature, cypress\integration\Nav │
│ igateScreen.feature, cypress\integration\PageViewScreen.feature, cypress\integrati │
│ on\SendRequestScreen.feature, cypress\integration\SetContextScreen.feature, cypres │
│ s\integration\SimpleFormScreen.feature, cypress\integration\TextInputScreen.featur │
│ e, cypress\integration\TextScreen.feature, cypress\integration\touchableScreen.fea │
│ ture │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
┌────────────────────────────────────────────────────────────────────────────────────────────────┐
│ √ AddChildrenScreen.feature 00:04 7 7 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ AlertScreen.feature 00:03 3 3 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ × ButtonScreen.feature 00:14 5 4 1 - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ ConditionalScreen.feature 00:06 6 6 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ × Confirm.feature 00:05 4 2 2 - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ × ConfirmScreen.feature 00:04 4 2 2 - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ ContainerScreen.feature 00:03 3 3 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ ImageScreen.feature 00:04 1 1 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ × ListViewScreen.feature 01:42 21 15 6 - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ NavigateScreen.feature 00:11 20 20 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ PageViewScreen.feature 00:04 4 4 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ × SendRequestScreen.feature 00:07 6 2 4 - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ SetContextScreen.feature 00:03 2 2 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ × SimpleFormScreen.feature 00:26 2 - 2 - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ × TextInputScreen.feature 00:21 16 15 1 - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ TextScreen.feature 00:07 11 11 - - - │
├────────────────────────────────────────────────────────────────────────────────────────────────┤
│ √ touchableScreen.feature 00:06 4 4 - - - │
└────────────────────────────────────────────────────────────────────────────────────────────────┘
× 7 of 17 failed (41%) 03:56 119 101 18 - -
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.