Behavior Driven Development for java – what framework to use? [closed]

Behavior Driven Development is just a technique that can be used without any tools. You can just write tests in BDD style – e.g. start test methods with should and introduce some separate feature with this method. When and then sections can be replaced with just comments, e.g. @Test public void should_do_something() { // given … Read more

running single rails unit/functional test

The following answer is based on: How to run single test from rails test suite? (stackoverflow) But very briefly, here’s the answer: ruby -I test test/functional/whatevertest.rb For a specific functional test, run: ruby -I test test/functional/whatevertest.rb -n test_should_get_index Just put underscores in places of spaces in test names (as above), or quote the title as … Read more

cy.url() and/or cy.location(‘href’) does not return a string

tl;dr Cypress commands are asynchronous, you have to use then to work with their yields. cy.url().then(url => { cy.get(‘.editor-toolbar-actions-save’).click(); cy.url().should(‘not.eq’, url); }); Explanation A similar question was asked on GitHub, and the official document on aliases explains this phenomenon in great detail: You cannot assign or work with the return values of any Cypress command. … Read more

How do you create tests for “make check” with GNU autotools

To make test run when you issue make check, you need to add them to the TESTS variable Assuming you’ve already built the executable that runs the unit tests, you just add the name of the executable to the TESTS variable like this: TESTS=my-test-executable It should then be automatically run when you make check, and … Read more

What is the best automated website UI testing framework [closed]

I definitively recommend Selenium, you can use it from .NET, supports different browsers, works in automatic builds and CI processes (we use it from CCNet). The code is stable. It has a few quirks, but after all they all do. Whichever tool you choose, I recommend making your own test facade class(es) around it. The … Read more

Best way to intercept XHR request on page with Puppeteer and return mock response

It seems that the way to go is request.respond() indeed, but still, I couldn’t find a concrete example in the web on how to use it. The way I did it was like this: // Intercept API response and pass mock data for Puppeteer await page.setRequestInterception(true); page.on(‘request’, request => { if (request.url() === constants.API) { … Read more

JUnit test report enrichment with JavaDoc

One way to achieve this would be to use a custom RunListener, with the caveat that it would be easier to use an annotation rather than javadoc. You would need to have a custom annotation such as: @TestDoc(text=”tests for XXX-342, fixes customer issue blahblah”) @Test public void testForReallyBigThings() { // stuff } RunListener listens to … Read more

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