protractor

Get HTTP requests (performance logs) from chromedriver with protractor

只谈情不闲聊 提交于 2020-07-17 11:06:37
问题 I'm using protractor for my e2e tests with angular and I'm trying desperately to get HTTP requests logs with headers and body. I've configured protractor like this: { useAllAngular2AppRoots: true, ignoreUncaughtExceptions: true, maxSessions: 1, multiCapabilities: [ { 'name': 'desktop', 'browserName': 'chrome', loggingPrefs: {"driver": "ALL", "browser": "ALL", 'performance': 'ALL'}, chromeOptions: { binary: process.env.CHROME_BIN, args: ["--headless", "--disable-gpu", "--no-sandbox"],

How to select an option with Angular Material 2 and Protractor?

你。 提交于 2020-07-09 12:57:49
问题 I'm writing some e2e tests with protractor. My application is an Angular Material 2 application. In my test I want to select an option of a md-select by value. When I inspect the open md-select I see the md-option items. The values of the options are in an attribute ng-reflect-value. Let's say I have an option with the value "optionA". How can I select a certain option by this value? I tried this: element(by.name('myselect')).click(); $$('.mat-option').then((options) => { ... }); and inside

Cannot find module '../drop-file.js' protractor, angular

本小妞迷上赌 提交于 2020-06-29 08:23:28
问题 I'm trying to use a module (source) in protractor , in a angular 9 app but i'm not able to and get the following error : Error: Error: Cannot find module './drop-file.js' The error say that it doesn't find the module but the module is correcly called as you can see bellow. my structure : drop-file.js test.po.ts test.po.ts : const dropFile = require('./drop-file.js'); export class ReviewPo { ... public uploadFiles() { ... dropFile(dropElement, './image.png'); ... } } drop-file.js : "use strict

directConnect:true vs starting seleniumServer at some port in Protractor

孤人 提交于 2020-06-27 16:05:33
问题 I am using Protractor for end-to-end Testing with non-angular app. So Once I have written in protractor.conf.js file as- exports.config = { directConnect: true, // Capabilities to be passed to the webdriver instance. capabilities: { 'browserName': 'chrome' }, // Framework to use. Jasmine is recommended. framework: 'jasmine', // Spec patterns are relative to the current working directory when // protractor is called. specs: ['example_spec.js'], // Options to be passed to Jasmine.

How to write into a particular cell using xlsx npm package

不打扰是莪最后的温柔 提交于 2020-06-26 08:14:22
问题 I have to write a value to a particular cell (say the D4 cell) in my xlsm file. I can see the option of XLSX.writeFile(workbook, 'out.xlsx'); in https://www.npmjs.com/package/xlsx#writing-functions to write , but I am not seeing anything to write a value to a particular cell(where should the values which needs to be written passed ?). Or, it is not as clear as the example provided to read a particular cell value. Would be glad if someone could provide me a simple example of snippet. This is

Cannot red property 'getText' protractor

偶尔善良 提交于 2020-06-17 09:42:46
问题 I am trying to do a loop into a loop and a get the Cannot red property 'getText' of undefined error. Here is my code: element.all(by.className('col-md-4 ng-scope')).then(function(content) { element.all(by.className('chart-small-titles dashboard-alignment ng-binding')) .then(function(items) { for(var i = 0; i<=content.length; i++) { items[i].getText().then(function(text) { expect(text).toBe(arrayTitle[i]); }); } }); element.all(by.className('mf-btn-invisible col-md-12 ng-scope')) .then

Cannot red property 'getText' protractor

百般思念 提交于 2020-06-17 09:42:11
问题 I am trying to do a loop into a loop and a get the Cannot red property 'getText' of undefined error. Here is my code: element.all(by.className('col-md-4 ng-scope')).then(function(content) { element.all(by.className('chart-small-titles dashboard-alignment ng-binding')) .then(function(items) { for(var i = 0; i<=content.length; i++) { items[i].getText().then(function(text) { expect(text).toBe(arrayTitle[i]); }); } }); element.all(by.className('mf-btn-invisible col-md-12 ng-scope')) .then

Cannot red property 'getText' protractor

倾然丶 夕夏残阳落幕 提交于 2020-06-17 09:42:07
问题 I am trying to do a loop into a loop and a get the Cannot red property 'getText' of undefined error. Here is my code: element.all(by.className('col-md-4 ng-scope')).then(function(content) { element.all(by.className('chart-small-titles dashboard-alignment ng-binding')) .then(function(items) { for(var i = 0; i<=content.length; i++) { items[i].getText().then(function(text) { expect(text).toBe(arrayTitle[i]); }); } }); element.all(by.className('mf-btn-invisible col-md-12 ng-scope')) .then

chrome-driver 83 compatibility with Ubuntu

拟墨画扇 提交于 2020-06-17 04:44:19
问题 I'm running Ubuntu 18.04.1 LTS and used stable versions of Google Chrome v81 and compatible chrome-driver v81 for a long time successfully. After reinstalling google-chrome-stable up to 83.0.4103.61 and updating chrome-driver up to 83.0.4103.39 . According to the official page they are fully compatible. But after these updates I'm getting error unable to connect to renderer . My capabilities remains the same: capabilities: { browserName: 'chrome', chromeOptions: { args: [ '--headless', '-

Wait for page redirection in Protractor / Webdriver

白昼怎懂夜的黑 提交于 2020-06-10 09:06:22
问题 I have a test that clicks a button and redirects to a user dashboard. When this happens Webdriver returns: javascript error: document unloaded while waiting for result. To fix this I insert browser.sleep(2000) at the point where redirection occurs and assuming my CPU usage is low, this solves the issue. However, 2000 ms is arbitrary and slow. Is there something like browser.waitForAngular() that will wait for the angular to load on the redirected page before the expect(..) ? it('should create