angular-e2e

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

Element is not clickable at point in headless mode. But when we remove headless from protractor.conf.js it is working fine.

让人想犯罪 __ 提交于 2021-01-27 12:13:00
问题 element(by.className('cuppa-dropdown')).element(by.className('dropdown-list')).element(by.className('list-area')).element(by.tagName('li')).click(); actually this element is in pop up. ANd it is woring fine in headless mode. But as we need to automate the test cases by build in vsts we need to execute test in headless mode Failed: unknown error: Element is not clickable at point (863, 343) (Session info: headless chrome=63.0.3239.84) (Driver info: chromedriver=2.34.522940

When developing e2e tests, Why is data-* attributes preferred for element selection over a plain id attribute

家住魔仙堡 提交于 2020-12-11 00:46:07
问题 Cypress and many other posts around testing web applications suggest relying on a data attribute like data-cy or data-test-id for locating elements rather than relying on the id attribute. My understanding is that for two reasons: The modern way of re-using the components can lead to having multiple components of same type and can lead to multiple of those Ids in the same page - But this should also apply to the 'data-cy' or 'data-test-id' attributes When Ids are tied to CSS, there is a

How to disable or bypass MSAL authentication when running Angular e2e tests?

回眸只為那壹抹淺笑 提交于 2020-12-06 07:03:05
问题 I want to set up some end to end tests for my Angular application, which requires the use of the MSAL library to authenticate with some downstream services. When I try to run my e2e tests locally, the MSAL library is forcing me to authenticate with a username/password. This is a problem because our CI/CD e2e testing should not have any human-intervention; thus I am looking for a way to either bypass the MSAL authentication or set up a service-account to login. Unfortunately there is not a lot

Run ng e2e with --element-explorer not working

故事扮演 提交于 2019-12-24 08:03:05
问题 I'm trying to figure out how I can debug my end to end tests. I'm usage protractor in an angular project and using the protractor-cucumber-framework custom framework. Given('[...]', async () => { await page.goToMeetupsListPage(); const profile: Profile = getMichel(); await page.setProfile(JSON.stringify(profile)); await page.refreshPage(); }); I'm setting a break point in this kind of function. Then I run the command ng e2e --element-explorer which is supposed to look for break points. Then I

Failed: script timeout: result was not received in 11 seconds From: Task: Protractor.waitForAngular() - Locator: By(css selector, #my-btn)

让人想犯罪 __ 提交于 2019-12-24 06:49:42
问题 I'm trying to write some e2e test for my Angular application using Protractor. I have a simple html button having id=my-btn which I want to click, using: $('#my-btn').click(); Unfortunately I'm getting the following errors: Failed: script timeout: result was not received in 11 seconds From: Task: Protractor.waitForAngular() - Locator: By(css selector, #my-btn) (Session info: chrome=73.0.3683.75) (Driver info: chromedriver=2.46.628411 (3324f4c8be9ff2f70a05a30ebc72ffb013e1a71e),platform=Mac OS

Protractor - invalid SSL certificate

為{幸葍}努か 提交于 2019-12-23 10:09:34
问题 We have an application and testing this locally shows an invalid SSL certificate warning. Normally I would just add an exception and get on with it. However is there anyway for protractor to ignore this? I've seen some capabilities in selenium where SSL can be ignored but can't seem to find any in protractor. 回答1: This works for me, (in conf file): capabilities: { browserName : 'firefox', marionette : true, acceptInsecureCerts : true } Hope that helps. 回答2: try webdriver-manager update -

Angular migration (from 4 to 6) e2e --proxy-config not working

大兔子大兔子 提交于 2019-12-10 12:37:56
问题 I've been currently migrating my app from 4 to 6 and I can not executing my proxy script for my e2e tests . The script listing looks as follows: "scripts": { "ng": "ng", "start": "ng serve", "start:tst1": "ng serve --proxy-config config/proxy/proxy.tst1.json", "start:tst5": "ng serve --proxy-config config/proxy/proxy.tst5.json", ... "test:watch": "ng test", "lint": "ng lint --type-check true", "e2e": "ng e2e", "e2e:tst1": "ng e2e --proxy-config config/proxy/proxy.tst1.json", "e2e:tst5": "ng

Ag-grid access and edit cell from Protractor e2e tests

北战南征 提交于 2019-12-08 10:19:40
问题 I'm looking to the right way to end to end test (e2e) an ag-grid angular application. protractor documentation says that you can use by.model(modelName) to sendKeys to an input field using ng-model. https://www.protractortest.org/#/api?view=ProtractorBy.prototype.model But ng-model is not an angular 2 directive I've tried for example this method but it's not working: const cellElement = element(by.model('row.name')); browser.actions().click(cellElement).perform(); //to get focus on cell