webdrivercss
webdrivercss copied to clipboard
Incorrect 2 test Mocha Example?
I'm new to Mocha, so bare with me, but in trying to set up multiple webdrivercss tests inside of a mocha test I followed the example in the readme file
// Example using Mocha
it('should check the first page',function(done) {
client
.init()
.url('https://example.com')
// Make this name unique.
.webdrivercss('page1', [
{
name: 'test',
screenWidth: [320,480,640,1024]
}, {
name: 'test_two',
screenWidth: [444,666]
}
])
.end()
.call(done);
});
it('should check the second page',function(done) {
client
// ...
// Make this name unique.
.webdrivercss('page2', [
// ..
])
// ...
);
I continued to get the following errors on the second "should check the second page" test.
Uncaught RuntimeError
(UnknownError:13) An unknown server-side error occurred while processing the command.
Problem: POST /session//url
I was able to resolve the issue by removing the .end()
function from the first test.
Is this the correct way to run tests? Does .end()
tell webdriver to stop? Should we update the documentation?
As a side note, is there any way we can improve the error message when this happens?
@micahgodbolt the end()
should happen in a after()
function so it won't close the connection. (unless if it's a single test you are running).
In a "shoovified" example you can see there's no end()
inside the it()
As a side note, is there any way we can improve the error message when this happens?
The (cryptic) error message is coming from here
@amitaibu @TheSavior we used to check if a command requires a session id but this seems to not work anymore. I created an issue to tackle this
@micahgodbolt you didn't get a session ID so somehow the init function wasn't executed or at least not executed successfully