e2e-testing

How to log Google Analytics calls in Testcafe?

拈花ヽ惹草 提交于 2019-12-06 14:11:33
问题 I am trying to automatically test tracking code and I am using the RequestLogger from Testcafé. I succeeded to intercept calls to example.com and localhost but not to https://www.google-analytics.com/ . What could be the reason? Expected This test should be green Test code import { RequestLogger } from 'testcafe'; const logger_ga = RequestLogger('https://www.google-analytics.com/'); fixture `localhost` .page('http://localhost:8000') test .requestHooks(logger_ga) ('logs calls to Google

Protractor starts Firefox but doesn't run any tests

江枫思渺然 提交于 2019-12-06 13:21:41
If I run protractor agains Firefox, Firefox is started and a blank tab is shown. Which is all I get (no specs are executed). After a while I get the following error: WebDriverError: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output: "}],"targetPlatforms":[],"seen":true} ... Now, I've also written a script which uses selenium webdriver directly, which works like a charm with FF. So, the problem must be protractor specific I would say! So, here is my protractor config file: require('babel-core/register'); // Spec files are in ES2015 exports.config = {

Expect: does not get the actual value

若如初见. 提交于 2019-12-06 11:53:14
I faced with very strange problem. I had a set of tests which I run daily on Jenkins and without any noticeable changes some asserts(expects) started fail. THe strange thing here is that they fails ONLY if I execute tests from Jenkins on Browserstack. Locally everything just fine, locally on browserstack everything is fine, on saucelabs everything is fine. I have 3 it() blocks with similar expects: value1 = $('.someclass'); value2 = .. value3 = .. expect(value1.getText()).toContain('tratata'); expect(value2.getText()).toContain('uhuhuhu'); expect(value3.getText()).toContain('ahahaha'); they

Making an API call while running protractor tests

穿精又带淫゛_ 提交于 2019-12-06 11:30:50
问题 I have built a web application using angular2.0 and typescript . Now I am writing E2E for my site using protractor . Now, in one of my tests I need to make an API call(HTTP GET request) and use the response value as an input in my test case. So basically I want to know how to make a GET request in Protractor-Jasmine and use the result/response. 回答1: Protractor runs on top of nodejs, and under the hood is calling Selenium API. You can use all of the node libraries, including request . Choose

How to locate [(ngModel)] for protractor tests

不打扰是莪最后的温柔 提交于 2019-12-06 10:50:36
<span class="selector-label">Team: </span> <select class="selector-component" [(ngModel)]="selectedTeamId"> <option *ngFor="#team of teams" [value]="team.id">{{team.name}}</option> </select> I am trying to add protractor tests for the selectedTeamId which is the first one sorted alphabetically if one user assigned to multiple teams. I think I should use [(ngModel)]="selectedTeamId", but not sure how to do it. thanks. I know how to get all teams, but I need to get the first one which is the logical implemented in selectedTeamId method. alecxe The idea would be to locate the select element (by

Mocking the date in Protractor

蓝咒 提交于 2019-12-06 09:55:50
I am writing a suite of end to end tests for my angular (4) application, using protractor. My backend is configured to connect to an exact replica of the production database, but filled with dummy data. A big part of my front end, is correctly displaying historic data. Currently, there is a certain period which has the data I want to display. However, obviously in a weeks time, my "Weekly" view will display all data as 0. Is it possible to trick protractor into thinking the date is within the period I seeded the dummy data, so the displayed data is predictable? Update: I now have this code:

Setting timezone in Protractor e2e tests

怎甘沉沦 提交于 2019-12-06 09:40:10
I have some Protractor e2e tests in which I deal with timezone. On my local machine they pass, on Appveyor they don't. I found out it's a timezone setting issue (different settings on Appveyor). Is there a way to set the timezone at the start of the test suite and bring it back the old one at the end? I tried this solution (so please don't mark this as duplicate): Set browser timezone in a Protractor test which I found to be a very ugly workaround. Anything prettier? You could use PowerShell to update the timezone and reset it after. This can be achieved using AppVeyor environment variables ,

“Mock” a backend http response with Protractor, Cucumber and Chai

本小妞迷上赌 提交于 2019-12-06 07:33:36
问题 First of all i will explain my goal : I have an app divided into several modules. In this case I just want to test my ui-module. I have some calls to the back-end there and i want to simulate the response or just change some models' values. I think you can not change the value of a model, so i am trying to simulate the back-end. I have a model 'documents' that when i press a search button, it get data from the back-end in other module. Example: http://localhost:8080/search-module/API/search I

What is the difference between UI/GUI testing, functional testing and E2E testing?

风流意气都作罢 提交于 2019-12-06 06:15:35
问题 I would say that all three are the same, but I wonder if there is small differences between them. In the end, what I think is that you are testing user scenarios on all of them. 回答1: UI testing : user interface testing. In other words, you have to make sure that all buttons, fields, labels and other elements on the screen work as assumed in a specification. GUI testing : graphical user interface. You have to make sure that all elements on the screen work as mentioned in a specification and

Protractor expectation that element is eventually present

℡╲_俬逩灬. 提交于 2019-12-06 06:11:30
问题 Is there a way to have an expectation that an element is eventually on the page? e.g. a way for browser.wait(protractor.ExpectedConditions.presenceOf(element(by.partialLinkText('Continue'))), 1000, 'Unable to find continue link'); to fail with an expectation error instead of a timeout? Essentially a way to have a isEventuallyPresent() instead of isPresent() in the line below expect(element(by.partialLinkText('Continue')).isPresent()).toBe(true); For reference, I'm using browser