a.com
August 9, 2019, 10:17pm
1
Anything better than selium for testing out a graphql/python/apollo/react app?
eluck
August 9, 2019, 10:36pm
2
Both Testcafe and Cypress are good substitutes to Selenium. There’s Puppeteer as well, but it’s bound to Chrome/Chromium browser.
4 Likes
We use Cypress and really enjoy it.
4 Likes
webdriver.io and nightwatchjs.org can both now run without Selenium, using just Chromedriver.
jestjs.io is more like Mocha, and is suppose to have particularly good React testing.
1 Like
a.com
August 18, 2019, 7:25pm
5
anyone know of a good tutorial on cypress (beyond their docs)?
1 Like
When you create a profile and start integrating with a project, you get a step by step tutorial as part of the integration. Also you get a folder with sample test code for a lot of things.
1 Like
I’m all in for this. Of course, aimed particularly to Meteor. Particular questions that raised in the first days of getting cypress into a Meteor project are:
How to programmatically login (or skip login for what it matters)
How to stub subscriptions and feed to collections
And about 1235123 others. But with these two I’d be really happy
Some answers to my first question have been placed here:
I did it like so:
Create a module that is loaded only when you are running integration tests
In this module, create a client side function createTestUser that calls Meteor’s Account.createUser with credentials you wish to use, so a fresh user is created for each test
Assign this function to window
Create a Cypress command login, something like this:
function login(win) {
win.createTestUser().then(() => win.appReady = true);
}
Cypress.Commands.add('login', () => {
cy.visit('/'); // loa…
and here:
That’s an interesting way to do it. We just login with a user that are in our test fixtures and we reset the db to these with each spec. Here’s some commands you can grab - some of which we grabbed from various forum posts and github issues over the months we’ve been using cypress. Apologies if I can’t remember who to attribute all the various bits to but I think @mitar & @florianbienefelt helped
Cypress.Commands.add("resetDb", () => {
const mongoport = 3001;
cy.exec(
…