e2e-testing

How to reuse yielded value later in the test

偶尔善良 提交于 2020-01-09 08:19:28
问题 Context: I have an element with innerText in Page1 and another element with innerText on Page 2. And I need to compare these two values in Page 3. So I need to find a way to save these values in a variable globally so that they can be used later. Things I tried: Trial 1: Didn't work as page1value scope is limited to the cy.get() cy.get('#selector').invoke('text').then(text => { const page1value = text }) Trial 2: Didn't work as whenever I try to print the value outside, it comes as undefined

How to retry failed test specs in protractor jasmine

浪尽此生 提交于 2020-01-06 14:18:11
问题 I am trying to use protractor-retry mechanism to run my protractor e2e tests. I have installed Protractor-retry package and added required things in conf.js file as below: var PropertiesReader = require('properties-reader'); var properties = PropertiesReader('config.properties'); var retry = require('protractor-retry').retry; exports.config = { plugins: [{ package: 'jasmine2-protractor-utils', disableHTMLReport: false, disableScreenshot: false, //screenshotPath: './reports/screenshots',

nightwatch.js internet explorer

让人想犯罪 __ 提交于 2020-01-05 21:05:03
问题 I'm using nightwatch for testing my javascript application. I need to be able to run cross-browser tests on local machine. Chrome and Firefox are OK, but when running test on IE, I got an error: Running: google.com TypeError: undefined is not a function at pass (C:\Users\Dávid\AppData\Roaming\npm\node_modules\nightwatch\lib\api\ assertions\urlContains.js:23:18) at Object.<anonymous> (C:\Users\Dávid\AppData\Roaming\npm\node_modules\night watch\lib\core\assertion.js:94:23) at HttpRequest.

nightwatch.js internet explorer

扶醉桌前 提交于 2020-01-05 21:04:08
问题 I'm using nightwatch for testing my javascript application. I need to be able to run cross-browser tests on local machine. Chrome and Firefox are OK, but when running test on IE, I got an error: Running: google.com TypeError: undefined is not a function at pass (C:\Users\Dávid\AppData\Roaming\npm\node_modules\nightwatch\lib\api\ assertions\urlContains.js:23:18) at Object.<anonymous> (C:\Users\Dávid\AppData\Roaming\npm\node_modules\night watch\lib\core\assertion.js:94:23) at HttpRequest.

Select OK button from N'th modal opened in testcafe

旧巷老猫 提交于 2019-12-31 02:02:15
问题 I open two modals in my testing, and I want to be able to click on the "OK" button in the second modal (the second selected element in the below html). My current code is : import { waitForReact } from 'testcafe-react-selectors'; import { Selector } from 'testcafe'; fixture `App tests` .page('http://localhost:3000/') .beforeEach(async () => { await waitForReact(); }); test('Can open and accept all pop ups', async t => { //open first modal await t .click('#LayerAddingPopUpButtonID'); //select

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

master runner in testcafe for several other runners?

℡╲_俬逩灬. 提交于 2019-12-24 07:39:11
问题 I have several runners which are using promise.race to complete the testcase at a particular time Say I have runner1.js, runner2.js runner3.js, how do I create a master runner so that I can run all these runners together? const createTestCafe = require('testcafe'); let testcafe = null; // createTestCafe('localhost', 1337, 1338) createTestCafe() .then(tc => { testcafe = tc; //create test runner for configuring and launching test tasks const runner = testcafe.createRunner(); return runner //run

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

How to group together certain tests or files when doing a run in Cypress?

混江龙づ霸主 提交于 2019-12-24 05:56:16
问题 I am currently running Cypress and I have folders inside of it, where I have tests located for different applications. I have a folder entitled "smhw-qa" which contains sub-folders and tests files for this specific application. This directory apps will also include other applications too in future. What I wish to do In order to avoid having to run every test for a run, I wish to only run this specific folder. The location of the folder is as such: 'cypress/integration/apps/smhw-qa' Over time,

Where are scripts in injectScripts injected in TestCafé tests?

假装没事ソ 提交于 2019-12-24 03:56:05
问题 I am setting up TestCafé tests programmatically and I use the injectScripts config on the Runner class to inject functions. According to the documentation, these scripts are added to the header of the tested page. Is it possible to invoke the functions from the test itself? I haven't found a way to do it. I can see that the scripts map is accessible inside the test and I can log out the content by doing console.log(t.testRun.opts.clientScripts) But it would be utterly ugly to parse this map