var searching = element.all(by.css('p.flex-container')).all(by.css('label'));
expect(searching.getText()).toEqual(['Старый пароль']).then(function(){
element(by.css('input.mm-input')).sendKeys('qwerty');
});
Expected [ 'Старый пароль', 'Новый пароль', 'Новый еще раз' ] to equal [ 'Старый пароль' ].
it('empty fields', function() {
browser.get('http://front.dukender.org.kz/home');
element(by.buttonText('Войти')).click();
element.getAttribute('Вы ввели неверный логин или пароль');
browser.pause();
});
[17:38:49] I/launcher - Running 1 instances of WebDriver
[17:38:49] I/direct - Using ChromeDriver directly...
Started
[31mF[0m
Failures:
1) login empty fields
Message:
[31m Failed: element.getAttribute is not a function[0m
Stack:
TypeError: element.getAttribute is not a function
at Object.<anonymous> (/Users/nursultan/Documents/protractortest/todo-spec.js:10:17)
at /usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:112:25
at new ManagedPromise (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:1067:7)
at ControlFlow.promise (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2396:12)
at schedulerExecute (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:95:18)
at TaskQueue.execute_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2970:14)
at TaskQueue.executeNext_ (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2953:27)
at asyncRun (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:2860:25)
at /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/promise.js:676:7
at process._tickCallback (internal/process/next_tick.js:109:7)
From: Task: Run it("empty fields") in control flow
at Object.<anonymous> (/usr/local/lib/node_modules/protractor/node_modules/jasminewd2/index.js:94:19)
From asynchronous test:
Error
at Suite.<anonymous> (/Users/nursultan/Documents/protractortest/todo-spec.js:5:5)
at Object.<anonymous> (/Users/nursultan/Documents/protractortest/todo-spec.js:1:1)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
1 spec, 1 failure
Finished in 0.04 seconds
[17:38:51] I/launcher - 0 instance(s) of WebDriver still running
[17:38:51] I/launcher - chrome #01 failed 1 test(s)
[17:38:51] I/launcher - overall: 1 failed spec(s)
[17:38:51] E/launcher - Process exited with error code 1
describe('login', function() {
it('empty fields', function() {
browser.get('http://front.dukender.org.kz/home');
element(by.buttonText('Войти')).click();
element(by.cssContainingText('p', 'Вы ввели неверный логин или пароль'));
browser.pause();
});
});