Skip to content

Cypress

Fast, easy and reliable testing for anything that runs in a browser.

Dependencies

Ubuntu/Debian:

apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

CentOS:

yum install -y xorg-x11-server-Xvfb gtk2-devel gtk3-devel libnotify-devel GConf2 nss libXScrnSaver alsa-lib

Headless mode

--headless 플래그를 함께 사용하면 된다.

Simple example

describe('HomeView.vue', () => {
  it('Visits the root page', () => {
    cy.visit('/');
    cy.get('#app').should('have.css', 'background-color', 'rgb(255, 255, 255)');
    cy.get('.hello-answer').should('include.text', 'ANSWER PLUGIN');
    cy.get('.v-item-group').children('.v-list-item').should('have.length', 2);
    cy.get('.v-item-group')
      .children('.v-list-item')
      .eq(0)
      .should('have.text', 'English');
    cy.get('.v-item-group').children('.v-list-item').eq(1).should('have.text', '한글');
  });

  it('Change Dark Mode', () => {
    cy.visit('/');
    cy.get('button').click();
    cy.get('#app').should('have.css', 'background-color', 'rgb(18, 18, 18)');
  });

  it('Change Language', () => {
    cy.visit('/');
    cy.get('button').click();
    cy.get('.v-item-group').children('.v-list-item').eq(0).click();
    cy.get('.hello-answer').should('include.text', 'Welcom to ANSWER PLUGIN!');
  });
});

Troubleshooting

cypress Your system is missing the dependency: Xvfb

종속성을 설치해야 한다. #Dependencies 항목 참조.

See also

Favorite site