protractor

paste url from clipbaord to browser address bar

 ̄綄美尐妖づ 提交于 2020-01-06 08:44:07
问题 I need to copy url and paste it to browser address bar. Unfortunately when I copy url there is no data attribute from where I can getText and paste. I used actions class as below to paste the url. But doesn't seem to work. HMTL code: <li class="copyLink"> <span class="link">Copy link</span> <input class="input" readonly=""> </li> await browser.executeScript("window.open(arguments[0], '_blank')"); // opens new tab await browser.actions().keyUp(protractor.Key.CONTROL).perform();//to paste in

Not able to get the values of a sorted ag-grid column in an array using Protractor and Typescript

情到浓时终转凉″ 提交于 2020-01-06 06:39:14
问题 I have to verify the sorting function in an ag-grid. When the UI is opened, the column data will be in some order. I am sorting it in ascending order and then storing the values in a array. ag_grid_utils.clickOnHeader("Name"); var testArr=[]; element.all(by.css('div.ag-body-container div[col-id="Name"]')) .map(function (Element) { element.getText().then(function (result) { console.log("result :: "+result); testArr.push(result); }); }) However when I print the array, the values are not sorted.

Not able to get the values of a sorted ag-grid column in an array using Protractor and Typescript

偶尔善良 提交于 2020-01-06 06:38:07
问题 I have to verify the sorting function in an ag-grid. When the UI is opened, the column data will be in some order. I am sorting it in ascending order and then storing the values in a array. ag_grid_utils.clickOnHeader("Name"); var testArr=[]; element.all(by.css('div.ag-body-container div[col-id="Name"]')) .map(function (Element) { element.getText().then(function (result) { console.log("result :: "+result); testArr.push(result); }); }) However when I print the array, the values are not sorted.

Fluent interface with protractor and typescript

我的未来我决定 提交于 2020-01-06 06:01:32
问题 I'm preparing project using protractor/typescript/jasmine. In other project we use java with fluent interface. I try to use it in this new project but I have a problem. On the bottom is error I get. Here is structure of it -Core --BasePage.ts -pages --LoginPage.ts -> extends LEPPage.ts --HomePage.ts -> extends LEPPage.ts --SearchPage.ts -> extends LEPPage.ts -LEPPage.ts (this is the part of page which is always displayed on each page - top menu and footer) -> extends BasePage.ts -tests --e2e

Protractor not waiting for angular2 to load

蹲街弑〆低调 提交于 2020-01-06 04:44:05
问题 Protractor version: 5.1.2 Node version: 6.9.0 Angular version: 2.4.10 OnPrepare function i am doing browser.get('/') . After this i am doing a login in a it . First issue is it throws error as async function was not called . After doing a failed research i added browser.sleep(500) then the above stopped to come and executed the login it case. After that i have to click a button on landing page and then navigate to another page and click another button.Here also it fails saying that no element

Dropdown in Protractor with typescript

怎甘沉沦 提交于 2020-01-06 04:43:04
问题 I m new to Protractor and I want to automate a dropdown selection. I have some idea on how to get it in javascript, but here i m using typescript. Can anyone suggest me on how to get the dropdown based on the text we pass. eg : <ul class="ui-dropdown-items ui-dropdown-list ui-widget-content ui-widget ui-corner-all ui-helper-reset ng-tns-c46-10 ng-star-inserted" style=""> <!----> <!----><!----> <!----> <!----><li class="ng-tns-c46-10 ui-dropdown-item ui-corner-all ng-star-inserted"> <!---->

Protractor - click within For Each not behaving as expected

血红的双手。 提交于 2020-01-06 04:35:12
问题 In Following Protractor Code const tabs = await element.all(by.id('tab')); tabs.forEach(async tab => { tab.click().then(function() { element.all(by.id('radio1')).click(); }); }); await element(by.id('saveAndContinue')).click(); radio1 is only clicked in last tab because of which last line of saveAndContinue is hidden and thus click() of it fails While Sleep does work outside of FOR loop it doesn't when i want to allow time before radio1 click EDIT 1 : Problem is every line is executing BUT

protractor bootstrap validation pop message

落花浮王杯 提交于 2020-01-05 07:05:45
问题 I want to do the validation using protractor for bootstrap pop up. I used the below code it ran successfully three times but now its getting null. element.all(by.css("input:required")).first().getText().then(function(text) { console.log(text); expect(text.should.be.equal("Please fill out this field.")); }) The pop up is similar to this: https://github.com/angular/protractor/issues/1209 来源: https://stackoverflow.com/questions/51674254/protractor-bootstrap-validation-pop-message

Protractor4.0.9 / jasmine2 / Chrome 54+: Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL

…衆ロ難τιáo~ 提交于 2020-01-05 06:53:42
问题 I know this question have been solved but it doesn't work for me. I upgrade to protractor4.0.9/Jasmine2, chromedriver 2.25, Chrome54. A simple test like this is failing: describe('Test', () => { it('should go to home', () => { browser.get('/#/home'); expect(browser.getCurrentUrl()).toContain('home'); }); it('should do something else', () => { expect(element(by.css('.element')).isPresent()).toEqual(true); }); }); it will never go through the second spec. Even though browser.get() is working.

Protractor 'toContain' error

我只是一个虾纸丫 提交于 2020-01-05 06:47:26
问题 This is my expect: expect(mandatoryFields[index].getAttribute('class')).toContain('error'); This is the error in console: Expected['formControl ng-pristine ng-untouched ng-valid ng-empty ng-valid-maxlength error'] to contain 'error'. Eventhough the class contains ERROR class name, protractor is still throwing error. What could be reason? Any help!!! 回答1: Instead of toContain try using toMatch . toContain is used to check whether the required value is present in an array or not. whereas