How to use Cypress Framework in aiTest

Language

  • JavaScript
Automation Framework
  • Cypress

How Cypress Framework is going to be used in aiTest

Cypress is well-suited for front-end testing, providing fast and reliable testing capabilities for web applications.aiTest support for Cypress allows you to perform cross-browser and cross-platform testing. You can validate the compatibility of your application across different browsers (Chrome, Firefox, etc.) and platforms (Windows, macOS, Linux, etc.). This helps ensure consistent behavior and user experience regardless of the browser or platform used by your end users.

  1. Sign up using your E-mail or Google account.
  2. Once you have reached the URL Test dashboard, navigate to the left-side menu and select the Multi-Browser Test.
  3. Hit the Create Test button.
  4. Configure your test:
    • Name the testrun: Give the name of testrun whatever you want or which is related to your application, So that it will be easy to get that particular testrun details whenever you want. i.e. test-example.com, test-demo.com, etc.
    • Project: Select a project in which you want to run your test or you can create a project by clicking on the red colored plus sign(+) button.
    • Testrun Description: Write some testrun description to make your testrun more informative.
    • AUT URL: Application Under Test URL. e.g. https://example.com
    • Now here you can choose Repo Details or Your Automation Code.
    • Repo Details: Provide the repo details User’s Git Repository URL, User’s Git Username, User’s Git Token or Password, Report File Location and Testrun Command.
    • Your Automation Code: If you select “Your Automation Code” in the previous step, you will need to upload your automation code in a zip file.
    • Testrun Command: Write testrun Command to Run your testrun Testcases npm run, npx cypress run --spec "<your automation test file>.cy.js" --browser <chrome/firefox/edge>
    • Report Location: Write Report Location to Stored your testrun Testcases Report Files Report/Test_Report.html, Report/Test_Report.json and Report/Test_Report.xml
  5. Select Browsers: At the end select the browser on which you want to run your test. Currently, we have 3 browsers such as, Google Chrome, Mozilla Firefox and Microsoft Edge with their different browser versions.
  6. Once you are done with the above steps you can do either of the following:
    • Run It Now: Immediately run the automation code to test the browser compatibility of your apps with across browsers and versions.
    • Save: Save the configuration for later run as draft testrun.
    • Cancel: Reset and go back to previous page.
    • Update: Update the configurations of the test and run new.
AUT code and can be accessed in aiTest through
  • GIT
  • .zip file

Code Snippets for Reference

Use the code snippet provided below:

JavaScript

  
/// 

describe('LoginSuite', function()
{
    it('verify the title of the page',function()
    {
    cy.visit('https://www.google.com')
    cy.title().should('eq','Google')

    })

    it('verify the title page-negative case',function()
    {
    cy.visit('http://54.172.57.167:3100/login')
    //cy.title().should('eq','To-do List')
    cy.get('#username').type("Omkar@12345")
    cy.get('.password-visibility-container').type("Omkar@12345")
    cy.get('.submit-button').click

    })
})
  

Questions Answered

  • How to use Cypress Framework in aiTest?
×

Subscribe

The latest tutorials sent straight to your inbox.