angularjs-e2e

Download a file protractor test case

折月煮酒 提交于 2019-11-28 22:36:42
问题 I am writting a protractor test case to download a file which can be of any type. Scenario: Download a file Step 1: Click on the Download Link Step 2: Check whether the file is downloaded or not How do i check if the file is downloaded correctly or not? 回答1: I was able to achieve download testing with Chrome. Follow this config setup: https://stackoverflow.com/a/26127745/511069 Create a function waitFileExists(fileAbsPath) and performs your expectations after the file is completely downloaded

Set browser timezone in a Protractor test

风格不统一 提交于 2019-11-28 09:58:28
问题 I'm working on a project where the e2e tests are made using protractor. Some tests, need to validate date/times. Tests are ok on our continuous deliver platforms that ensure the timezone remains stable. However, when test are run on a local machine, where timezone can change, tests fail because the captured browser is running on a different timezone. I need to, somehow, control the timezone through protractor in order to have platform independent tests. Is this possible? 回答1: Late answer, but

Protractor: Testing Angular App in an Iframe

流过昼夜 提交于 2019-11-28 09:48:45
I've got an interesting setup here. I have an Angular App that loads another Angular App inside an iframe. I'm interested in testing the iframed-in Angular app with Protractor. Protractor is waiting for the first Angular app to load, but when I switch the iframe with ptor.switchTo().frame('experience'); I can see that Protractor is not waiting for the iframed Angular app before making assertions. I have tried adding ptor.waitForAngular(); After switching to the iframe with no luck. Anybody have any ideas what is going on here? Thanks! If it helps, I'm running my tests through the Saucelabs ssh

Protractor file download test fails when headless chrome

廉价感情. 提交于 2019-11-28 04:19:10
问题 I am having an issue with a protractor test. It was working, but now (even thought nothing has changed) it is not. The test is just opening the app (web application) and clicking on a button to download an image. The download should start straight away. The problem is that the next instruction after the download event throws an exception, Failed: chrome not reachable. I am using the latest chrome and chrome driver versions. The capabilites section for protractor is like this: capabilities: {

Running into Error while waiting for Protractor to sync with the page with basic protractor test

喜你入骨 提交于 2019-11-27 14:18:52
describe('my homepage', function() { var ptor = protractor.getInstance(); beforeEach(function(){ // ptor.ignoreSynchronization = true; ptor.get('http://localhost/myApp/home.html'); // ptor.sleep(5000); }) describe('login', function(){ var email = element.all(protractor.By.id('email')) , pass = ptor.findElement(protractor.By.id('password')) , loginBtn = ptor.findElement(protractor.By.css('#login button')) ; it('should input and login', function(){ // email.then(function(obj){ // console.log('email', obj) // }) email.sendKeys('josephine@hotmail.com'); pass.sendKeys('shakalakabam'); loginBtn

How to simulate a drag and drop action in protractor?

僤鯓⒐⒋嵵緔 提交于 2019-11-27 09:17:01
I have a double slider and I'd like to test that it's operable and return's the right data. The slider has a min and a max handler, it also has some "breakpoints that I can hook to. " What I want to simulate is a touchStart of the ".handler-max" element a move of the thumb over the element with class ".step-3" a touchEnd of the ".handler-max" element while I found how to trigger a touchStart and a touchEnd event. I'm clueless on how to simulate the move of the thumb browser.executeScript('angular.element(arguments[0]).triggerHandler("touchstart");', filterHandler); // <--- move event????

Protractor find element inside a repeater

走远了吗. 提交于 2019-11-27 05:49:22
问题 Below is my markup <tr ng-repeat="post in posts"> <td ng-click="activePost(post)" class="title">{{post.title}}</td> <td><button class="btn btn-danger" ng-click="delete(post)">Delete</button> </td> </tr> I'm trying to get the element with the title class. The code I use to access the repeater is: postsList = element.all(by.repeater('post in posts')); Is there a way to get the element by doing something like the following in jQuery: var titleText = $("tr:first").find(".title").text(); Is there

How to simulate a drag and drop action in protractor?

你离开我真会死。 提交于 2019-11-26 14:37:10
问题 I have a double slider and I'd like to test that it's operable and return's the right data. The slider has a min and a max handler, it also has some "breakpoints that I can hook to. " What I want to simulate is a touchStart of the ".handler-max" element a move of the thumb over the element with class ".step-3" a touchEnd of the ".handler-max" element while I found how to trigger a touchStart and a touchEnd event. I'm clueless on how to simulate the move of the thumb browser.executeScript(