I'm using protractor 1.8.0 and jasmine 2.1.3 but I can't run a single test when I use ddescribe and then iit. I get:
Message: ReferenceError: iit is not defined
I have a lot of test cases and want to just run 1 for debugging purposes. Is there a way to do this?
Do I need to $npm install jasmine-focused or is it already part of jasmine 2.1.3?
@Aaron I went ahead and uninstalled and reinstall. Ran the test and got the same error. Here is the output after install.
/usr/local/bin/protractor -> /usr/local/lib/node_modules/protractor/bin/protractor
/usr/local/bin/webdriver-manager -> /usr/local/lib/node_modules/protractor/bin/webdriver-manager
[email protected] /usr/local/lib/node_modules/protractor
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected])
describe('Login page', function() { beforeEach(function() { browser. ignoreSynchronization = true; ptor = protractor. getInstance(); }); it('should contain navigation items', function(){ //test case code here }); it('should login the user successfully', function(){ //test case code here }) });
When you want to run protractor scripts by opening a browser instance for each test, you should add two capabilities shardTestFiles and maxInstances in the Capabilities block of the conf. js file. This will help to execute your scripts on same browser with multiple instances.
The syntax for that as of 2.1 is fdescribe
and fit
. Source
describe('a test', function() {
it('spec 1', function() {
console.log('1');
});
it('spec 2', function() {
console.log('2');
});
it('spec 3', function() {
console.log('3');
});
});
This will print:
1
.2
.3
.
Meanwhile:
fdescribe('a test', function() {
it('spec 1', function() {
console.log('1');
});
fit('spec 2', function() {
console.log('2');
});
it('spec 3', function() {
console.log('3');
});
});
Will print:
2
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With