When should we use .then with Protractor Promise?

The answer of this question can be found in this post : http://spin.atomicobject.com/2014/12/17/asynchronous-testing-protractor-angular/ That is : Protractor enqueue all driver commands in the ControlFlow, when you need the result of a driver command you should use .then, when you don’t need the result of a driver you can avoid .then but all following instructions must … Read more

how can I get the current url using protractor?

If you want to just check the current URL, then use browser.getCurrentUrl(): expect(browser.getCurrentUrl()).toEqual(“expectedUrl”); But, if you need to wait until URL matches a certain value, see the next part of the answer. Here is a working code based on the example provided by the author of the Expected Conditions: var urlChanged = function(url) { return … Read more

Protractor e2e test case for downloading pdf file

I can currently set download path location Chrome capabilities: { ‘browserName’: ‘chrome’, ‘platform’: ‘ANY’, ‘version’: ‘ANY’, ‘chromeOptions’: { // Get rid of –ignore-certificate yellow warning args: [‘–no-sandbox’, ‘–test-type=browser’], // Set download path and avoid prompting for download even though // this is already the default on Chrome but for completeness prefs: { ‘download’: { ‘prompt_for_download’: … Read more

Integrating Protractor with Yeoman via Grunt

Install protractor and grunt-protractor-runner from npm: npm install protractor grunt-protractor-runner –save-dev Create a config file for protractor (protractor.conf.js), change specs and baseUrl to your test files and test server: exports.config = { seleniumAddress: ‘http://localhost:4444/wd/hub’, specs: [‘test/e2e/*_test.js’], baseUrl: ‘http://localhost:9001’ //default test port with Yeoman } Update your Gruntfile.js, add the following after the karma task: protractor: … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)