GithubHelp home page GithubHelp logo

cypress's Introduction

Cypress Confidence Test

In our session we are going to work on developing a set of confidence tests

Prerequisites

Node

Node.js and npm should be installed.

node -v
npm -v

Cypress IDE Extensions & Plugins

IntelliJ or VS Code is highly suggested, they both of good integration with cypress.
Review the Extensions-Plugins

Getting Started

We will create a set of tests for the search features in ICPSR.

Create and new directory for out project

mkdir confidence

Now Initialize our node project. You can take all of the defaults.

cd confidence
npm init -y

Now install cypress and open up the interactive runner

npm install cypress --save-dev

npx cypress open

Cypress has sample tests pre-loaded but we will not use these so in the runner window "No thanks, delete example files". Create your first test file, find-head-start.js

Head Start Study Page Test

Find the Head Start ICPSR 4134 and view the study page.

  • visit site (https://www.icpsr.umich.edu/)
  • find search input
  • type "Head Start"
  • verify search results
  • navigate to the study page
  • verify tabs

Find the Head Start ICPSR 4134 and view the study page.

describe('Find Head Start', () => {
    it('Visit', () => {
        cy.visit("https://www.icpsr.umich.edu");
    });
});
  • Find Head start
  it('find head start ', function () {
    cy.visit("https://www.icpsr.umich.edu");
    cy.get('#test-search-box').type("head start 4134");
    cy.get("form").submit();
    cy.get("h1").contains("Search Results").should("exist");
  });

Open Study

  it('open study ', function () {
    cy.get('a[href$="studies/4134"]').click();
    cy.get("h1").contains("ICPSR 4134").should("exist");
  });

Verify Tabs

    it('verify summary tab', function () {
        cy.get('#summaryLink').click();
        cy.location('pathname').should('contain', '/summary');
      });
      it('data documentation tab ', function () {
        cy.get('#datadocumentationLink').click();
        cy.location('pathname').should('contain', '/datadocumentation');
      });
    
      it('variables tab ', function () {
        cy.get('#variablesLink').click();
        cy.location('pathname').should('contain', '/variables');
      });

Notes

cypress's People

Contributors

gregfarris avatar

Watchers

James Cloos avatar  avatar

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.