automated-tests

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

Testcafe example to assert file download

与世无争的帅哥 提交于 2019-12-24 03:51:10
问题 I want to write a fixture to simulate the export file and make sure a file is downloaded from browser actions. any example? NA 回答1: There's not a fancy way check if the download has finished, TestCafe is somewhat limited in its ability to control the download ability in the browser. import fs from 'fs'; const fileName = 'junk.txt'; const downloadLocation = 'C:\\Wherever\\Downloads\\'; const fileDLUrlBase = 'https://example.com/downloads/'; fixture('download test fixture'); test('download test

SmallCheck: Making types instance of typeclass Serial

大兔子大兔子 提交于 2019-12-24 03:49:20
问题 I'm trying to figure out how to use the smallcheck property-based test library in conjunction with tasty. I ran into a problem with multi-field record types: How can I make a record type with mor than 4 fields member of the Serial typeclass? I assume that this would be the normal way to go: {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} import Test.Tasty import Test.Tasty.SmallCheck import Test.SmallCheck.Series data T1 = T1 { p1 :: Int, p2 :: Char, p3 :: [Int] } deriving (Show, Eq

How to click unrendered virtualized element in TestCafe

拜拜、爱过 提交于 2019-12-24 03:47:10
问题 I'm using react-virtualized for a lengthy (1000+) list of items to select from. And I'm trying to set up an end to end test that requires clicking on one of the elements that are not currently rendered. Ordinarily, I'd simply use something like: await t.click( ReactSelector('ListPage') .findReact('ListItem') .nth(873) // or .withText(...) or .withProps(...) ) But because only a small subset of the ListItem s are rendered, TestCafe fails to find the desired element. I've been trying to figure

Frame handling in Webdriver IO

做~自己de王妃 提交于 2019-12-24 03:45:12
问题 I am testing a webpage that has multiple forms in it. When I use client.frame({id:client.element('#frameId')}); I don't get any error, but when I try to interact with an element within that frame I get a RuntimeError telling me the element could not be located. I have been looking out for literature about how the frame() method works but I don't have any luck. 回答1: I was also using webdriver.io and it looks like documentation is a bit wrong. You can access frames: 1) via it's number on the

Testing DAX calculation with NBi

一个人想着一个人 提交于 2019-12-24 02:55:09
问题 I'm doing some research on automated test tool for our SSAS Tabular project. I found NBi and thought it is really cool. I attempted to set it up and successfully ran some basic tests. However, when I attempted to test dax calculation, it says "Function not found" (see screenshot). It sounds like it does not support SUM, but given that SUM is a basic function I would imagine it should work. Since I'm new to this tool, I wanted to double check if I've done something wrong or it is simply what

Get Elements By Attributes

爷,独闯天下 提交于 2019-12-24 02:25:45
问题 i will be short. As far as i know watir library provides two methods for getting html elements. Almost for each element (div, button, table, li, etc) watir provides two methods: . One is the 'singular' method which gets only one specific element. For example: watir_instance.div(:id,'my_div_id') watir_instance.link(:href,'my_link_href') watir_instance.button(:class =>'my_button_class', :index => 4) These methods will only retrieve A SINGLE ELEMENT. Thats ok... . The second is the 'plural'

Selenium, automated frontend testing on different OS

南楼画角 提交于 2019-12-24 02:23:21
问题 My complete working environment is Linux based (Ubuntu for desktop and server). I use Hudson and Selenium to execute tests on my EE6/ZK web application with any browser available for Ubuntu. But how would I test my application with IE (Windows) without setting up a Selenium server in Windows. Thought I could run Windows in a VMWare or Virtualbox, but still it needs a "local" selenium and how would I trigger it ? Install hudson as well and pretty much replicate the complete CI in Windows ? How

Selenium 3.0 ExpectedConditions issue

感情迁移 提交于 2019-12-24 01:59:28
问题 Using a click() implementation as follows, selenium will act as if it clicked the button, and will expect the next screen. But the webpage will not receive the click so the next screen will not pop up. I don't really understand what it is going on, maybe some of you encountered this issue before. Here's the click implementation: public static void click(WebDriver driver, By by) { new WebDriverWait(driver, DEFAULT_WAIT_FOR_ELEMENT) .until(ExpectedConditions.elementToBeClickable(by)) .click();

Is it wise to defer unit-testing until integration tests pass in scenarios where behavior of a 3rd-party API is largely unknown?

孤街浪徒 提交于 2019-12-24 01:48:06
问题 I don't mean defer all unit-testing until an integration test passes. The unit tests I'm referring to are those that verify that the SUT interacts with the 3rd-party mystery API correctly. The rationale for deferring these unit tests is that they verify something that is unknown. If I don't know how the 3rd-party mystery API works, how can I even write a unit test to ensure that the SUT uses the 3rd-party API correctly? Only once some minimal integration tests pass do I actually know what