Code Monkey home page Code Monkey logo

beagle-web-components's People

Contributors

aureliodinizzup avatar carolinegoncalveszup avatar igorgiumellizup avatar jamessonpenhazup avatar lg95 avatar pedronaveszup avatar pedropnaves avatar rafamsilva avatar raphaelspimenta avatar tayronearaujo avatar tayronemachadozup avatar tiagoperes avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beagle-web-components's Issues

bug: Button test failing in CI

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                                              

Integrated Tests

We should create integrated tests for every component that we have.

Update PageView to have Context

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

bug: Cypress | fix analytics tests

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)

bug: Fix list view test

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.

feat: refactor Cypress tests

The project located at automated-tests/common/ needs some refactoring such as:

  • reduce code repetition
  • remove generic operations from specific classes, so these operations could be used globally, avoiding code repetition
  • remove explicit sleep methods (ex cy.wait), using fluent wait approaches
  • remove PageObjects and elements file that could be substituted by the already mentioned refactorings
  • add an element validation at the init() method of class BeaglePage to enforce the page is really loaded. To achieve this, consider an abstract method that would be called inside init(). The subclasses would have to implement this abstract method with the elements of the corresponding page

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

Run tests on a schedule

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.

bug: angular9 tests are failing

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        -        -



Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.