quasarframework / quasar-testing

Testing Harness App Extensions for the Quasar Framework 2.0+
https://testing.quasar.dev
MIT License
180 stars 65 forks source link

Documentation on q-toggle, q-select and props e2e testing with Cypress? #275

Closed khteh closed 2 years ago

khteh commented 2 years ago

Would this be the right approach for q-toggle?

    cy.get('[data-test="toggle-setting-0"]').eq(false);
    cy.get('[data-test="toggle-setting-0"]').focus().click();
    cy.get('[data-test="toggle-setting-0"]').eq(true);

And how to test the props, for instance with Jest:

    expect(popUpEditNumber.props().hint).toEqual("Popup Edit box (Number) hint");
    expect(popUpEditNumber.props().dataType).toEqual("number");
    expect(autoGenerate.vm.internalOptions.length).toEqual(3);

Software version

OS: Ubuntu 22.04 Node: NPM: Any other software related to your bug:

What did you get as the error?

What were you expecting?

What steps did you take, to get the error?

IlCallo commented 2 years ago

Check out the docs: https://github.com/quasarframework/quasar-testing/blob/dev/packages/e2e-cypress/README.md#automatic-override-of-cypress-commands

khteh commented 2 years ago

How to test props? It's not there in the doc you provided.

IlCallo commented 2 years ago

The docs I provided are about Cypress AE custom commands and overrides It seems to me you should first study Vue Test Utils and Cypress, as from the multiple issues you opened it's pretty obvious you lack some fundamentals

Cypress AE is nothing more than a small transparent overlay to ease Cypress integration, this means you need to understand and know the underlying technologies (via their docs) to be able to use it correctly. This is written into the docs too: image

That aside, you can find examples here: https://github.com/quasarframework/quasar-testing/tree/dev/test-project-webpack/src/components/__tests__