protractor

Protractor browser.wait doesn't wait

青春壹個敷衍的年華 提交于 2021-02-05 19:38:03
问题 I am assuming that browser.wait should be a blocking call, but it is not working as I expected. Here is my sample: describe("browser.wait", function() { beforeEach(function() { browser.wait(function() { console.log('1 - BeforeEach WAIT'); return true; }); console.log('2 - BeforeEach after wait'); }); afterEach(function() { browser.wait(function() { console.log('4 - afterEach WAIT'); return true; }); console.log('5 - afterEach after wait'); }); it('should probably actually wait.', function() {

Attach screenshot to cucumber-html-reporter using cucumber-tsflow and protractor

两盒软妹~` 提交于 2021-02-05 08:10:53
问题 After every failed scenario, I would like to attach a screenshot to html report (generated by cucumber-html-reporter, using cucumber-tsflow and protractor. Is that possible? As far as I understand, I don't have access to the world instance anymore when writing the steps using cucumber-tsflow. Otherwise something like this.attach(screenshot, 'image/png'); would have done the trick. After googling for a while, I saw some people attaching the screenshot to the scenario like scenario.attach

Getting “Driver info: driver.version: unknown” while running scripts using protractor

僤鯓⒐⒋嵵緔 提交于 2021-02-05 07:17:05
问题 I am getting below error while executing the scripts in protractor. System info: host: '8888', ip: '88888', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.15.7', java.version: '14.0.1' Driver info: driver.version: unknown [13:13:08] E/launcher - WebDriverError: Timed out waiting for driver server to start. Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53' System info: host: '****', ip: '****', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10

When should element.all(locator).then(thenFunction) or element.all(locator) be used?

試著忘記壹切 提交于 2021-02-04 21:38:57
问题 In protractor, what's the difference between (source): Example 1 const allOptions = element.all(by.options('fruit for fruit in fruits')); expect(await allOptions.count()).toEqual(4); and (source): Example 2 const arr = await element.all(by.model('color')); expect(arr.length).toEqual(3); Why if I do... Example 3 let allOptions = await element.all(by.css('.mat-option-text > span')); let firstOption = allOptions.first(); ...I get this static typescript error? Property 'first' does not exist on

Protractor Extension of ElementFinder

僤鯓⒐⒋嵵緔 提交于 2021-01-29 13:54:35
问题 I am trying to extend the ElementFinder of Protractor with a few additional methods. I am doing this exactly the same way I also extended other classes, where it works without any problem. In a separate file called 'protractor-extension.ts', both the module declaration and the method implementation is contained: declare module 'protractor/built/element' { export interface ElementFinder { safeClick() : Promise<void>; } } (protractor.ElementFinderas any).safeClick= function () { const _self =

Protractor W3C capability

浪尽此生 提交于 2021-01-29 10:50:19
问题 I am using Protractor with Selenoid . I need to use the dockerized Windows images so that I can test Internet Explorer and Edge from Linux boxes. I was able to make it work from curl by running: curl -X POST http://127.0.0.1:4444/wd/hub/session -d '{"capabilities":{"browserName":"MicrosoftEdge","count":1,"alwaysMatch":{"browserName":"MicrosoftEdge","selenoid:options":{"enableVNC":true,"enableVideo":false,"enableLog":true,"logName":"edge-18.0.log"}}}}' My protractor config looks like:

Protractor with jasmine does not show stack traces to line with error

岁酱吖の 提交于 2021-01-29 07:09:37
问题 I've got a protractor test that does this: it('Test', async () => { throw new Error() } When this errors, it outputs this: ✗ Test - Failed: Error at callWhenIdle (.../node_modules/jasminewd2/index.js:62:5) at .../node_modules/jasminewd2/index.js:127:13 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7) (node:43369) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): Error: EPIPE write EPIPE How do I get a useful stack trace that says the

How can I pass a fake media stream to safari IOS in browserStack capability?

£可爱£侵袭症+ 提交于 2021-01-29 02:58:14
问题 I am using protractor and selenium with browser stack and trying to automate a webrtc web application, I need to get rid of browser asking for permission and using a fake stream instead of real camera and mic as available in chrome. I have tried using these options they both do not work. Option 1: var capabilities = { 'browserName': 'iPhone', 'device': 'iPhone 6S', 'realMobile': 'true', 'os_version': '11.4', "media.navigator.permission.disabled": true, "media.navigator.streams.fake": true };

Unable to select value from autocomplete using protractor

六月ゝ 毕业季﹏ 提交于 2021-01-28 18:37:12
问题 <select name="Name" class="metaselect ignore" style="display: none;" xpath="1"> <option value="00000000-0000-0000-0000-000000000000" selected="selected">-- New --</option> <option value="bd434f35-90db-e911-aa59-a96c125b4266">AddtoTest</option> <option value="e8b6fd1b-e2f3-e911-aa64-e16c52c442dc">APINV_EPIC06</option> <option value="35cfdd50-c47a-e911-aa37-8fe9ba6f0d87">Approve</option> <option value="70da50aa-e2a3-e911-aa45-8f65b76e1edb">Basic</option> <option value="5af85ad8-5ac0-e911-aa4f

Unable to select value from autocomplete using protractor

百般思念 提交于 2021-01-28 18:31:10
问题 <select name="Name" class="metaselect ignore" style="display: none;" xpath="1"> <option value="00000000-0000-0000-0000-000000000000" selected="selected">-- New --</option> <option value="bd434f35-90db-e911-aa59-a96c125b4266">AddtoTest</option> <option value="e8b6fd1b-e2f3-e911-aa64-e16c52c442dc">APINV_EPIC06</option> <option value="35cfdd50-c47a-e911-aa37-8fe9ba6f0d87">Approve</option> <option value="70da50aa-e2a3-e911-aa45-8f65b76e1edb">Basic</option> <option value="5af85ad8-5ac0-e911-aa4f