Should e2e tests persist data in real databases?

I’m currently working at a large well-known company on our test tools and frameworks team. So while I’m no expert, it is something that’s part of my job. I’m going to be talking specifically about web testing. Testing is somewhat different for native apps like iOS and Android and I’m not super familiar with those … Read more

Cypress – How can I run test files in order

I have a particular case where I launch multiple instances of an app, rather than using fixtures or test data, I simply integrate user feedback as Cypress tests from login on forwards. In any case, I used the specPattern configuration property in cypress.json to set the spec file run order: { “baseUrl”: “http://localhost:5000”, “specPattern”: [ … Read more

Cypress: How to know if element is visible or not in using If condition?

Cypress allows jQuery to work with DOM elements so this will work for you: cy.get(“selector_for_your_button”).then($button => { if ($button.is(‘:visible’)){ //you get here only if button is visible } }) UPDATE: You need to differentiate between button existing and button being visible. The code below differentiates between 3 various scenarios (exists & visible, exists & not … Read more

What is the difference between using `react-testing-library` and `cypress`?

You’ve answered your question in the first line. If you want to test your React app end-to-end, connected to APIs and deployed somewhere, you’d use Cypress. react-testing-library‘s aimed at a lower level of your app, making sure your components work as expected. With Cypress, your app might be deployed on an environment behind CDNs, using … Read more

Error trying to get attribute from element in Cypress

invoke() calls a jquery function on the element. To get the value of an input, use the function val(): cy.get(‘input’).invoke(‘val’).should(‘contain’, ‘mytext’) This is not the same as getting the value attribute which will not update with user input, it only presets the value when the element renders. To get an attribute, you can use the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)