testcafe

Is there a way in TestCafe to validate Chrome network calls?

左心房为你撑大大i 提交于 2019-12-06 03:21:01
I have a test case where I need to navigate to a webPage and validate the network calls in chrome browser for that page. Ideally, I would take them in a variable and filter them for certain analytics related calls and validate their values. This can be done through chrome capabilities in Selenium. See doc here: http://chromedriver.chromium.org/logging/performance-log but I am trying to do this through testCafe? I came across this documentation: https://devexpress.github.io/testcafe/documentation/test-api/intercepting-http-requests/ on testCafe site but I am not sure if this is same as getting

TestCafe with Electron: Determine if app is visible on Windows desktop

馋奶兔 提交于 2019-12-05 19:01:24
Our Electron application starts minimized to the Windows tray notification area i.e. not visible on the desktop. If I attempt to get visibility information through methods such as this or as described here , checking the 'visible' property always returns true . For example, the below always returns true whether the app is minimized to the notification area or visible on the desktop: if(await Selector('button', { visibilityCheck: true }).visible) console.log("VISIBLE"); else console.log("NOT VISIBLE"); As a hail-mary, I have also attempted to check the 'focused' property but that also always

How to log Google Analytics calls in Testcafe?

℡╲_俬逩灬. 提交于 2019-12-04 19:57:02
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 Analytics', async t => { await t.click("#ga-button"); console.log(logger_ga.requests); // is empty due to

Select OK button from N'th modal opened in testcafe

邮差的信 提交于 2019-12-01 21:28:57
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 OK button from first modal const modalOKButton = Selector('div.ant-modal') .find('div.ant-modal-footer'

Testcafe - Test command line argument outside test case

£可爱£侵袭症+ 提交于 2019-12-01 17:47:56
As I'm getting familiar with Testcafe, I'm trying to use a command line argument to give the user more information on how to run tests. For that reason, I'm using the minimist package. However, I cannot print or use any variables outside the test cases. Please find below my code. import { Selector } from 'testcafe'; import minimist from 'minimist'; const args = minimist(process.argv.slice(2)); const env = args.env; console.log('*** A SAMPLE CONSOLE OUTPUT ***'); // does not print fixture `Getting Started` .page `http://devexpress.github.io/testcafe/example`; test('My first test', async t => {

Testcafe - Test command line argument outside test case

强颜欢笑 提交于 2019-12-01 17:44:54
问题 As I'm getting familiar with Testcafe, I'm trying to use a command line argument to give the user more information on how to run tests. For that reason, I'm using the minimist package. However, I cannot print or use any variables outside the test cases. Please find below my code. import { Selector } from 'testcafe'; import minimist from 'minimist'; const args = minimist(process.argv.slice(2)); const env = args.env; console.log('*** A SAMPLE CONSOLE OUTPUT ***'); // does not print fixture

TestCafe - How to check if a web element exists or does not exist without failing the test?

可紊 提交于 2019-12-01 03:15:26
I'm trying to write a script that needs to adapt it's workflow behavior depending on whether a particular browser object found by CSS selector exists or does not exist. I do not want to use a document.getElementByID method as this is not technically a CSS selector, and our entire enterprise is standardized on CSS selector so anything that walks the DOM other then a CSS selector won't make it past our code review process anyway. var thing = await things.thingSelector(thingName); if (await t.expect(thing.exists).notOk()) { await t.click(things.OpenThing(thingName)); } else { return false; }

TestCafe - How to check if a web element exists or does not exist without failing the test?

爷,独闯天下 提交于 2019-11-28 02:50:45
问题 I'm trying to write a script that needs to adapt it's workflow behavior depending on whether a particular browser object found by CSS selector exists or does not exist. I do not want to use a document.getElementByID method as this is not technically a CSS selector, and our entire enterprise is standardized on CSS selector so anything that walks the DOM other then a CSS selector won't make it past our code review process anyway. var thing = await things.thingSelector(thingName); if (await t