0 Best Reply Awards

  • Member Since 3 Months Ago
  • 47 Lessons Completed
  • 5 Favorites

6th October, 2017

TesterP started a new conversation Dusk - Use DatabaseMigrations With MongoDB • 1 week ago

Has anyone got migration to work in Dusk with a MongoDB? Any special tricks needed?

I have a Mongo database with loads of data, including users with different roles and access to different parts of the data.

Instead of creating everything from scratch for every test, I want to use this database and I want to roll back to the original db afterwards (or before each test).

I read that database transactions doesn't work with Dusk, but I can't get database migration to work either.

When I add "use DatabaseMigrations;" at the beginning of a test class, all my tests get RuntimeException: aborted

Using Dusk 1.1

24th September, 2017

TesterP left a reply on Passing A Variable To The Page Url In Dusk • 3 weeks ago

For me it was easier to pass in an id, not an object. Modified the code to something similar to this:

public function __construct($id) ... public function url() { return '/users/' . $this->id . '/edit'; }

Working brilliantly. Thanks @slewis for showing your solution. Helped me a lot.

Edit Your Profile

Want to change your profile photo? We pull from gravatar.com.