e2e-testing

Intermittently failing tests with Protractor - promise order execution?

狂风中的少年 提交于 2019-12-12 03:46:38
问题 I am facing intermittent protractor test failures across a range of test suites without any real pattern in the fail cases to indicate what could be going on, for example it's not the same tests that are failing. Sometimes I will get many failures and on other occasions just a single fail case. I should point out that this tends to only happen when performing test runs on a Jenkins CI server we have configured (running under linux). Locally on Windows dev machines we may get a single fail

Protractor - works well on localhost but remote throws Timeout - Async callback was not invoked within timeout specified

≡放荡痞女 提交于 2019-12-12 01:14:01
问题 When I execute protractor protractor.conf.js --baseUrl=http://localhost:4200/ , it works well - fills data, validates elements, etc. When I try to test exactly the same website via remote URL protractor protractor.conf.js --baseUrl=http://the-same-website.com/ , it opens up in browser, logins and all necessary parts are loaded like in localhost but Protractor/Jasmine does not fill/click/validate anything and I get timeout after specified time: - Error: Timeout - Async callback was not invoked

Cypress login using request method

China☆狼群 提交于 2019-12-11 15:50:20
问题 I register & login a user, however, when in my test I navigate to a page behind authentication, Cypress fails & takes me back to the login page. From the looks of it, the before function is successfully executed (as verified by the API log). Here is my code: describe("Dashboard page", () => { before(() => { cy.fixture("authUserRegistrationDetail.json").then(userDetail => { cy.fixture("authUserLoginDetail.json").then(userLoginDetail => { cy.visit("http://localhost:3000/login"); cy.get("

TestCafe ClientFunction TypeError error as document is undefined

妖精的绣舞 提交于 2019-12-11 13:41:52
问题 I can successfully execute the following .click: const clickMockContinueButton = ClientFunction(() => document.getElementsByName("paymentGatewayIframeReturnSubmit")[0].click()) by calling it with: await clickMockContinueButton(); But even after the successful .click I get a TypeError: An error occurred in ClientFunction code: TypeError: document.getElementsByName(...)[0] is undefined What am I doing wrong here? * EDIT with workaround * Seems there is a bug in my mocked page when I use either

Using testCafe 'requestLogger' to retrieve chrome performance logs fails

[亡魂溺海] 提交于 2019-12-11 12:43:12
问题 This is in continuation of this thread: Is there a way in TestCafe to validate Chrome network calls? Here is my testCafe attempt to retrieve all the network logs(i.e. network tab in developer tools) from chrome. I am having issues getting anything printed on console. const logger = RequestLogger('https://studenthome.com',{ logRequestHeaders: true, logRequestBody: true, logResponseHeaders: true, logResponseBody: true }); test ('My test - Demo', async t => { await t.navigateTo('https://appURL

Get row number using text in the row in Protractor

我是研究僧i 提交于 2019-12-11 09:52:59
问题 I have the table structured below <table class="table"> <thead> <tr> <th class="checkbox-column"></th> <th class="main-column main-column--checkbox">Name</th> </tr> </thead> <tbody ng-repeat="(a, b) in tests" class="ng-scope" style=""> <tr class="panel__sub-header"> <td> <input name="item-checkbox" ng-click="toggleSelectAll(a)" type="checkbox"> </td> <td colspan="4"> <h4 class="ng-binding">ROW2</h4> </td> </tr> <tr ng-repeat="test in testData" ng-class-odd="'odd'" ng-class-even="'even'" class

TestCafe docker- unable to run tests using runner class

♀尐吖头ヾ 提交于 2019-12-11 05:44:05
问题 I have all my tests running in docker container and it works fine. Since, I have a few test files which needs concurrent tests and a file which doesn't need concurrent test that is the reason I need to create a test runner to run my tests. Here is what my test runner class looks like: const createTestCafe = require('testcafe'); let testcafe = null; createTestCafe('localhost', 1337, 1338) .then((tc) => { testcafe = tc; const runner1 = testcafe.createRunner(); const runner2 = testcafe

How do you prevent the tests from stopping on the first failed test case?

谁说我不能喝 提交于 2019-12-11 03:38:01
问题 I'm attempting to check if certain pieces of content are present, on different pages. For example: const contentCount = Selector('.some-element').childElementCount .expect(contentCount).gte(1, 'The related content is missing.') ... Which works fine, except that the testing stops after the first assertion fails. This isn't ideal as I'm trying to generate a report that shows ALL of the failed assertions at once. How do I get the test to keep running after a failed assertion? 回答1: Answering your

Check for value within test of TestCafe

杀马特。学长 韩版系。学妹 提交于 2019-12-10 22:33:54
问题 I use TestCafe to automate testing a specific function. In this function, the user is only allowed to have 5 entries. On the site is a label that indicates how many entries are left. When the user already has 5 entries it should delete one in order to test adding a new one. The html markup of the page is: <p class="pull-left text-muted">5 / 5 possible entries</p> Now I want to get exactly this string to make a little if/else with JavaScript to delete an entry when it says 5 / 5 possible

TestCafe - The browser always starts in clean slate between the tests. How to override this so that browser remembers cache, user settings and storage

醉酒当歌 提交于 2019-12-10 21:44:22
问题 The browser between the Tests is always open in a clean slate. The Login is remembered in my application as Authentication persists but as the browser is opened in clean slate always, I have to perform Login in Before hook of all Fixtures. Is there some way I can open browser so that user settings, cache, local and session storage are remembered? 回答1: TestCafe doesn't offer a way to store the page state between tests and encourages writing independent tests. However, Roles API may meet some