Giter Club home page Giter Club logo

Comments (2)

kinow avatar kinow commented on June 26, 2024

Cypress can be executed with npm run test:e2e. That will open a browser (which looks to be an Electron desktop app calling a browser/url?). Alternatively, it is possible to run in headless mode with npm run test:e2e -- --headless.

After if finishes executing the tests, it also produces some interesting artefacts, besides the normal test result. The tests produce screen shots. The example below was created under tests/e2e/test.js/, where test.js is the name of the file with the test, and in the file name there is more info about the test and the status (failed in this case).

my first test -- visits the app root url failed

Furthermore, Cypress also automatically produces videos of the tests, which can be useful for both showcasing new features, and also auditing security or functional tests. The test.js produces test.js.mp4, which can be used directly, or we can ffmpeg -i test.js.mp4 -r 15 test.js.gif to produce a low res GIF.

test js

from cylc-ui.

kinow avatar kinow commented on June 26, 2024

Output running the current tests with the command line:

$ npm run test:e2e -- --headless

> [email protected] test:e2e /home/kinow/Development/python/workspace/cylc-web
> vue-cli-service test:e2e "--headless"

 INFO  Starting e2e tests...
 INFO  Starting development server...


 WARNING  Compiled with 2 warnings                                                                                                                                                                         13:41:45

 warning  

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets: 
  fonts/materialdesignicons-webfont.abb4e749.eot (407 KiB)
  fonts/materialdesignicons-webfont.d15c1216.ttf (407 KiB)
  img/materialdesignicons-webfont.ae4dbede.svg (3.05 MiB)
  img/do.88a82fcc.svg (443 KiB)
  img/do.704fd2a9.svg (456 KiB)
  css/chunk-vendors.1b4b7ebc.css (409 KiB)
  js/chunk-vendors.8644aea6.js (739 KiB)

 warning  

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (1.18 MiB)
      css/chunk-vendors.1b4b7ebc.css
      js/chunk-vendors.8644aea6.js
      css/app.5e93a2a9.css
      js/app.aaf6922b.js



  App running at:
  - Local:   http://localhost:8080/ 
  - Network: http://10.0.2.15:8080/

  App is served in production mode.
  Note this is for preview or E2E testing only.


====================================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:    3.1.5                                                                              │
  │ Browser:    Electron 59 (headless)                                                             │
  │ Specs:      2 found (dashboard.js, userprofile.js)                                             │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running: dashboard.js...                                                                 (1 of 2) 


  My First Test
    ✓ Visits the app root url (2538ms)


  1 passing (3s)


  (Results)

  ┌────────────────────────────┐
  │ Tests:        1            │
  │ Passing:      1            │
  │ Failing:      0            │
  │ Pending:      0            │
  │ Skipped:      0            │
  │ Screenshots:  0            │
  │ Video:        true         │
  │ Duration:     2 seconds    │
  │ Spec Ran:     dashboard.js │
  └────────────────────────────┘


  (Video)

  - Started processing:   Compressing to 32 CRF
  - Finished processing:  tests/e2e/videos/dashboard.js.mp4 (1 second)


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running: userprofile.js...                                                               (2 of 2) 


  User Profile
    ✓ Visits the user profile (1582ms)


  1 passing (2s)


  (Results)

  ┌──────────────────────────────┐
  │ Tests:        1              │
  │ Passing:      1              │
  │ Failing:      0              │
  │ Pending:      0              │
  │ Skipped:      0              │
  │ Screenshots:  0              │
  │ Video:        true           │
  │ Duration:     1 second       │
  │ Spec Ran:     userprofile.js │
  └──────────────────────────────┘


  (Video)

  - Started processing:   Compressing to 32 CRF
  - Finished processing:  tests/e2e/videos/userprofile.js.mp4 (0 seconds)


====================================================================================================

  (Run Finished)


      Spec                                                Tests  Passing  Failing  Pending  Skipped 
  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ ✔ dashboard.js                              00:02        1        1        -        -        - │
  ├────────────────────────────────────────────────────────────────────────────────────────────────┤
  │ ✔ userprofile.js                            00:01        1        1        -        -        - │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘
    All specs passed!                           00:04        2        2        -        -        -

from cylc-ui.

Related Issues (20)

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.