TestCafe 为现代web开发堆栈提供自动化的跨浏览器测试
TestCafe 为现代web开发堆栈提供自动化的跨浏览器测试。它是一个纯NodeJS的web应用程序测试解决方案。它负责所有的阶段:启动浏览器,运行测试,收集测试结果并生成报告 AndreyBelym released this
Assets
2
v1.0.0 (2018-2-7)
Breaking Changes
💥
Test Syntax Validation Disabled: All Input Files Are Executed
Previous versions performed test syntax validation within input script files before executing them. Only files that contained the fixture and test directives were executed.
Starting with v1.0.0, input script files are never validated. This means that TestCafe executes all the scripts you specify as test sources. If you use Glob patterns to specify input test files, please recheck these patterns to avoid unintended file matches.
The --disable-test-syntax-validation
command line flag and the disableTestSyntaxValidation
option for the runner.run API method that disabled test syntax validation were removed in v1.0.0.
What Has Improved
You can now load tests dynamically without additional customization. The following example illustrates how tests can be imported from an external library.
external-lib.js
export default function runFixture(name, url) {
fixture(name)
.page(url);
test(`${url} test`, async t => {
// ...
});
}
test.js
import runFixture from './external-lib';
const fixtureName = 'My fixture';
const url = 'https://testPage';
runFixture(fixtureName, url);
💥
Programming Interface: Multiple Method Calls Prohibited
Previous versions allowed you to call the runner.src, runner.browsers and runner.reporter methods several times to specify multiple test files, browsers or reporters.
const stream = fs.createWriteStream('report.json');
runner
.src('/home/user/tests/fixture1.js')
.src('fixture5.js')
.browsers('chrome')
.browsers('firefox:headless')
.reporter('minimal')
.reporter('json', stream);
Starting with v1.0.0, pass arrays to these methods to specify multiple values.
To use a reporter that writes to a file, add a { name, output }
object to an array (see the runner.reporter description for details).
runner
.src(['/home/user/tests/fixture1.js', 'fixture5.js'])
.browsers(['chrome', 'firefox:headless'])
.reporter(['minimal', { name: 'json', output: 'report.json' }]);
What Has Improved
This change was necessary to implement the configuration file in a way that is consistent with the API and command line interface.
💥
Custom Request Hooks: Asynchronous API
Request hook methods became asynchronous in TestCafe v1.0.0.
If the onRequest or onResponse method in your custom hook returns a Promise, TestCafe now waits for this Promise to resolve.
This does not necessarily leads to unexpected behavior, but still be aware of possible side effects.
Since the onRequest and onResponse methods are now asynchronous, add the async
keyword to their declarations.
import { RequestHook } from 'testcafe';
class MyRequestHook extends RequestHook {
constructor (requestFilterRules, responseEventConfigureOpts) {
super(requestFilterRules, responseEventConfigureOpts);
// ...
}
async onRequest (event) {
// ...
}
async onResponse (event) {
// ...
}
}
What Has Improved
You can call asynchronous fs functions, invoke a child_process, or perform asynchronous network requests (to a database or any other server) from inside the hooks.
💥
Custom Reporter Plugins: Asynchronous API
TestCafe v1.0.0 also introduces asynchronous API for reporter plugins.
Similarly to request hooks, if any of the custom reporter's methods (reportTaskStart, reportFixtureStart, reportTestDone or reportTaskDone) returns a Promise, this Promise is now awaited.
Side effects may show up in certain cases.
Since the reporter methods are now asynchronous, add the async
keyword to their declarations.
async reportTaskStart (startTime, userAgents, testCount) {
// ...
},
async reportFixtureStart (name, path, meta) {
// ...
},
async reportTestDone (name, testRunInfo, meta) {
// ...
},
async reportTaskDone (endTime, passed, warnings, result) {
// ...
}
What Has Improved
Reporters can call asynchronous fs functions, invoke a child_process, or perform asynchronous network requests (to send an email, use REST API, connect to a database, etc).
Enhancements
⚙️
Video Recording (#2151)
You can now record videos of test runs in Google Chrome and Mozilla Firefox. To enable video recording, install the FFmpeg library and then do one of the following:
-
specify the --video command line flag,
testcafe chrome test.js --video artifacts/videos/
-
call the runner.video API method,
runner.video('artifacts/videos/');
-
specify the videoPath configuration file property (configuration file is also a new feature, see below).
{ "videoPath": "artifacts/videos/" }
TestCafe records all tests and saves each recording in a separate file. You can change this behavior in video options. You can also customize video encoding parameters.
⚙️
Configuration File (#3131)
TestCafe now allows you to store its settings in the .testcaferc.json
configuration file (with support for JSON5 syntax).
{
"browsers": "chrome",
"src": ["/home/user/auth-tests/fixture-1.js", "/home/user/mobile-tests/"],
"reporter": {
"name": "xunit",
"output": "reports/report.xml"
},
"screenshotPath": "/home/user/tests/screenshots/",
"takeScreenshotsOnFails": true,
"videoPath": "/home/user/tests/videos/",
"pageLoadTimeout": 1000,
"hostname": "host.mycorp.com"
// and more
}
Keep the configuration file in the project's root directory from which you run TestCafe.
Settings you specify when you launch tests from the command line and programming interfaces override settings from .testcaferc.json
.
See Configuration File for more information.
⚙️
Live Mode (#3215)
We have integrated the testcafe-live module into our main code so you can now use the new live mode.
Live mode keeps the TestCafe process and browsers opened the whole time you are working on tests. Changes you make in code immediately restart the tests. That is, live mode allows you to see test results instantly. See How Live Mode Works.
Use the -L (--live) flag to enable live mode from the command line interface.
testcafe chrome tests/test.js -L
In the API, create a live mode runner with the testcafe.createLiveModeRunner function and use it instead of a regular test runner.
const createTestCafe = require('testcafe');
let testcafe = null;
createTestCafe('localhost', 1337, 1338)
.then(tc => {
testcafe = tc;
const liveRunner = testcafe.createLiveModeRunner();
return liveRunner
.src('tests/test.js')
.browsers('chrome')
.run();
})
.then(() => {
testcafe.close();
});
⚙️
Custom Reporter API Enhancements (Part of #2753; Pull Request)
-
You can now access warnings that appeared during the test run from the reportTestDone method. Use the
warnings
property of the testRunInfo object.async reportTestDone (name, testRunInfo, meta) { const warnings = testRunInfo.warnings; const hasWarnings = !!warnings.length; if(hasWarnings) { this.newline() .write('Warnings:'); warnings.forEach(warning => { this.newline() .write(warning); }); } }
-
The reportTaskDone method now receives the result parameter that contains information about the number of passed, failed, and skipped tests.
async reportTaskDone (endTime, passed, warnings, result) { this.write(`Testing finished!`) .newline() .write(`Passed: ${result.passedCount}`) .newline() .write(`Failed: ${result.failedCount}`) .newline(); .write(`Skipped: ${result.skippedCount}`) .newline(); }
⚙️
Typings for Programming Interface (#3341) by @infctr
TestCafe programming interface now features TypeScript typings.
⚙️
Programming Interface: Simpler API to Write Reports to a File
You no longer need to use fs.createWriteStream
to create a stream that writes a report to a file. You can now pass the file name as the runner.reporter parameter.
runnner.reporter('json', 'reports/report.json');
Bug Fixes
- The test runner no longer hangs when a custom reporter implementation uses synchronous callbacks (#3209)
- Fixture hooks for two adjacent fixtures are now executed in the correct order (#3298)
- Iframes no longer throw an error after a
document.open
call in IE and Edge (#3343) - TestCafe no longer triggers a click event when you disable a button with a
span
element inside (#2902) - Fixed a bug that led to errors in certain cases (#3189)
- We have improved the status panel design and adaptivity (#3073)
- Redirects through several pages in iframes now work correctly (testcafe-hammerhead/#1825)
- TestCafe can now correctly work with pages that override
HTMLElement.classList
in IE11 (testcafe-hammerhead/#1890)
Assets
2
Update hammerhead; Bump version (v1.0.0-alpha.4) (#3371)
AndreyBelym released this
Assets
2
Bump version (v1.0.0-alpha.3) (#3363)
AndreyBelym released this
Assets
2
Update hammerhead; Bump version (v1.0.0-alpha.2) (#3313)
AndreyBelym released this
Assets
2
Bump version (v1.0.0-alpha.1) (#3256)
AndreyBelym released this
Assets
2
v0.23.3 (2018-12-19)
Bug Fixes
- Remote browsers now start after tests are compiled (#3219) by @link89
- The TestCafe Docker image now includes version tags (#2315)
- Tests now fail with a meaningful error if no fixture is defined (#2913)
- Tests now resume correctly after a long waiting (#3070)
- TestCafe now throws a meaningful exception when taking screenshots in a browser that does not support it (#2878)
- Events are now simulated in the correct order when focusing an element after another element was focused on the
changed
event (#3098) - The
Invalid calling object
exception is no longer thrown in IE11 (testcafe-hammerhead/#1846) - The JSON parse error is no longer thrown when sending an XHR request (testcafe-hammerhead/#1839)
- Overridden functions now have the right prototype in an
iframe
withoutsrc
(testcafe-hammerhead/#1824) gulp-testcafe
now correctly closes Chrome after tests are finished (testcafe-hammerhead/#1826)- Saving the
window
prototype to a property now works correctly (testcafe-hammerhead/#1828) - Hammerhead is now retained after
document.close
in Firefox (testcafe-hammerhead/#1821)
Assets
2
Bump version (v0,23,3-alpha.4)
Assets
2
Bump version (v0.23.3-alpha.2) (#3162)
Assets
2
Bump version (v0.23.3-alpha.1) (#3145)
AndreyBelym released this
Assets
2
Assets
2
Refresh node_modules when publishing; Bump version (v0.23.2-alpha.1) … …(#3101)
Assets
2
v0.23.1 (2018-11-7)
Enhancements
⚙️
Select Tests and Fixtures to Run by Their Metadata (#2527) by @NickCis
You can now run only those tests or fixtures whose metadata contains a specific set of values.
Use the --test-meta flag to specify values to look for in test metadata.
testcafe chrome my-tests --test-meta device=mobile,env=production
To select fixtures by their metadata, use the --fixture-meta flag.
testcafe chrome my-tests --fixture-meta subsystem=payments,type=regression
In the API, test and fixture metadata is now passed to the runner.filter method in the testMeta
and fixtureMeta
parameters. Use this metadata to decide whether to run the current test.
runner.filter((testName, fixtureName, fixturePath, testMeta, fixtureMeta) => {
return testMeta.mobile === 'true' &&
fixtureMeta.env === 'staging';
});
⚙️
Run Dynamically Loaded Tests (#2074)
You can now run tests imported from external libraries or generated dynamically even if the .js
file you provide to TestCafe does not contain any tests.
Previously, this was not possible because TestCafe required test files to contain the fixture and test directives. Now you can bypass this check. To do this, provide the --disable-test-syntax-validation command line flag.
testcafe safari test.js --disable-test-syntax-validation
In the API, use the disableTestSyntaxValidation option.
runner.run({ disableTestSyntaxValidation: true })
Bug Fixes
- Touch events are now simulated with correct touch properties (
touches
,targetTouches
,changedTouches
) (#2856) - Google Chrome now closes correctly on macOS after tests are finished (#2860)
- Internal attribute and node changes no longer provoke
MutationObserver
notifications (testcafe-hammerhead/#1769) - The
ECONNABORTED
error is no longer raised (testcafe-hammerhead/#1744) - Websites that use
Location.ancestorOrigins
are now proxied correctly (testcafe-hammerhead/#1342)
Assets
2
alpha 3 (#3072)
Assets
2
Bump version (v0.23.1-alpha.2)
Assets
2
v0.23.0 (2018-10-18)
Enhancements
⚙️
Stop Test Run After the First Test Fail (#1323)
You can now configure TestCafe to stop the entire test run after the first test fail. This saves your time when you fix problems with your tests one by one.
Specify the --sf flag to enable this feature when you run tests from the command line.
testcafe chrome my-tests --sf
In the API, use the stopOnFirstFail option.
runner.run({ stopOnFirstFail: true })
⚙️
View the JavaScript Errors' Stack Traces in Reports (#2043)
Now when a JavaScript error occurs on the tested webpage, the test run report includes a stack trace for this error (only if the --skip-js-errors option is disabled).
⚙️
Browsers are Automatically Restarted When They Stop Responding (#1815)
If a browser stops responding while it executes tests, TestCafe restarts the browser and reruns the current test in a new browser instance.
If the same problem occurs with this test two more times, the test run finishes and an error is thrown.
Bug Fixes
- An error message about an unawaited call to an async function is no longer displayed when an uncaught error occurs (#2557)
- A request hook is no longer added multiple times when a filter rule is used (#2650)
- Screenshot links in test run reports now contain paths specified by the
--screenshot-pattern
option (#2726) - Assertion chains no longer produce unhandled promise rejections (#2852)
- The
moment
loader now works correctly in the Jest environment (#2500) - TestCafe no longer hangs if the screenshot directory contains forbidden symbols (#681)
- The
--ssl
option's parameters are now parsed correctly (#2924) - TestCafe now throws a meaningful error if an assertion method is missing (#1063)
- TestCafe no longer hangs when it clicks a custom element (#2861)
- TestCafe now performs keyboard navigation between radio buttons/groups in a way that matches the native browser behavior (#2067, #2045)
- The
fetch
method can now be used with data URLs (#2865) - The
switchToIframe
function no longer throws an error (#2956) - TestCafe can now scroll through fixed elements when the action has custom offsets (#2978)
- You can now specify the current directory or its parent directories as the base path to store screenshots (#2975)
- Tests no longer hang up when you try to debug in headless browsers (#2846)
- The
removeEventListener
function now works correctly when an object is passed as its third argument (testcafe-hammerhead/#1737) - Hammerhead no longer adds the
event
property to a nullcontentWindow
in IE11 (testcafe-hammerhead/#1684) - The browser no longer resets connection with the server for no reason (testcafe-hammerhead/#1647)
- Hammerhead now stringifies values correctly before outputting them to the console (testcafe-hammerhead/#1750)
- A document fragment from the top window can now be correctly appended to an iframe (testcafe-hammerhead/#912)
- Lifecycle callbacks that result from the
document.registerElement
method are no longer called twice (testcafe-hammerhead/#695)
v0.21.1
AndreyBelym released this
v0.21.1 (2018-8-8)
Bug fixes
- The
RequestLogger.clear
method no longer raises an error if it is called during a long running request (#2688) - TestCafe now uses native methods to work with the
fetch
request (#2686) - A URL now resolves correctly for elements in a
document.implementation
instance (testcafe-hammerhead/#1673) - Response header names specified via the
respond
function are lower-cased now (testcafe-hammerhead/#1704) - The cookie domain validation rule on the client side has been fixed (testcafe-hammerhead/#1702)
v0.21.0
AndreyBelym released this
v0.21.0 (2018-8-2)
Enhancements
⚙️
Test Web Pages Served Over HTTPS (#1985)
Some browser features (like Service Workers, Geolocation API, ApplePaySession, or SubtleCrypto) require a secure origin. This means that the website should use the HTTPS protocol.
Starting with v0.21.0, TestCafe can serve proxied web pages over HTTPS. This allows you to test pages that require a secure origin.
To enable HTTPS when you use TestCafe through the command line, specify the --ssl flag followed by the HTTPS server options. The most commonly used options are described in the TLS topic in the Node.js documentation.
testcafe --ssl pfx=path/to/file.pfx;rejectUnauthorized=true;...
When you use a programming API, pass the HTTPS server options to the createTestCafe method.
'use strict';
const createTestCafe = require('testcafe');
const selfSignedSertificate = require('openssl-self-signed-certificate');
let runner = null;
const sslOptions = {
key: selfSignedSertificate.key,
cert: selfSignedSertificate.cert
};
createTestCafe('localhost', 1337, 1338, sslOptions)
.then(testcafe => {
runner = testcafe.createRunner();
})
.then(() => {
return runner
.src('test.js')
// Browsers restrict self-signed certificate usage unless you
// explicitly set a flag specific to each browser.
// For Chrome, this is '--allow-insecure-localhost'.
.browsers('chrome --allow-insecure-localhost')
.run();
});
See Connect to TestCafe Server over HTTPS for more information.
⚙️
Construct Screenshot Paths with Patterns (#2152)
You can now use patterns to construct paths to screenshots. TestCafe provides a number of placeholders you can include in the path, for example, ${DATE}
, ${TIME}
, ${USERAGENT}
, etc. For a complete list, refer to the command line --screenshot-path-pattern flag description.
You specify a screenshot path pattern when you run tests. Each time TestCafe takes a screenshot, it substitutes the placeholders with actual values and saves the screenshot to the resulting path.
The following example shows how to specify a screenshot path pattern through the command line:
testcafe all test.js -s screenshots -p "${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png"
When you use a programming API, pass the screenshot path pattern to the runner.screenshots method.
runner.screenshots('reports/screenshots/', true, '${TEST_INDEX}/${OS}/${BROWSER}-v${BROWSER_VERSION}/${FILE_INDEX}.png');
⚙️
Add Info About Screenshots and Quarantine Attempts to Custom Reports (#2216)
Custom reporters can now access screenshots' data and the history of quarantine attempts (if the test run in the quarantine mode).
The following information about screenshots is now available:
- the path to the screenshot file,
- the path to the thumbnail image,
- the browser's user agent,
- the quarantine attempt number (if the screenshot was taken in the quarantine mode),
- whether the screenshot was taken because the test failed.
If the test was run in the quarantine mode, you can also determine which attempts failed and passed.
Refer to the reportTestDone method description for details on how to access this information.
Bug Fixes
- HTML5 drag events are no longer simulated if
event.preventDefault
is called for themousedown
event (#2529) - File upload no longer causes an exception when there are several file inputs on the page (#2642)
- File upload now works with inputs that have the
required
attribute (#2509) - The
load
event listener is no longer triggered when added to an image (testcafe-hammerhead/#1688)
v0.21.0-alpha.1
AndreyBelym released this
Bump version (v0.21.0-alpha.1) (#2679)
v0.20.5
AndreyBelym released this
v0.20.5 (2018-7-18)
Bug fixes
- The
buttons
property was added to theMouseEvent
instance (#2056) - Response headers were converted to lowercase (#2534)
- Updated flow definitions (#2053)
- An
AttributesWrapper
instance is now updated when the the element's property specifies thedisabled
attribute (#2539) - TestCafe no longer hangs when it redirects from a tested page to the 'about:error' page with a hash (#2371)
- TestCafe now reports a warning for a mocked request if CORS validation failed (#2482)
- Prevented situations when a request logger tries to stringify a body that is not logged (#2555)
- The Selector API now reports
NaN
instead ofinteger
when type validation fails (#2470) - Enabled
noImplicitAny
and disabledskipLibCheck
in the TypeScript compiler (#2497) - Pages with
rel=prefetch
links no longer hang during test execution (#2528) - Fixed the
TypeError: this.res.setHeader is not a function
error in Firefox (#2438) - The
formtarget
attribute was overridden (testcafe-hammerhead/#1513) fetch.toString()
now equalsfunction fetch() { [native code] }
(testcafe-hammerhead/#1662)
v0.20.5-alpha.1
AndreyBelym released this
Bump version (v0.20.5-alpha.1) (#2611)
v0.20.4
AndreyBelym released this
v0.20.4 (2018-6-25)
Enhancements
TestCafe now takes screenshots using browsers' debug protocols (#2492)
Bug fixes
fetch
requests are now correctly proxied in a specific case (testcafe-hammerhead/#1613)- Resources responding with
304
HTTP status code and with the 'content-length: ' header are proxied correctly now (testcafe-hammerhead/#1602) - The
transfer
argument ofwindow.postMessage
is passed correctly now (testcafe-hammerhead/#1535) - Incorrect focus events order in IE has been fixed (#2072)
v0.20.3
AndreyBelym released this
v0.20.3 (2018-6-6)
Enhancements
⚙️
Add TS definitions to the Docker image (#2481)
Bug fixes
- Selection in a
contenteditable
div
now works properly in a specific scenario (#2365) - A collision related to several
moment-duration-format
package versions is now fixed (#1750) - TestCafe now reports a warning when saving several screenshots at the same path (#2213)
- A regression related to wrongly processed
document.write
in IE11 is now fixed (#2469) - An out of memory crash on calling console methods is now fixed (testcafe-hammerhead/#1546)
Click
action for an element with 1px height or width works properly now (#2020)- Touch emulation for the latest Google Chrome was fixed (#2448)
v0.20.2
AndreyBelym released this
v0.20.2 (2018-5-24)
⚙️
Package dependencies have been upgraded to avoid CVEs reported by Node Security Platform
Bug fixes
- Enabled the screenshot and window resizing functionalities in the concurrency mode for Firefox and Chrome on macOS #2095
v0.20.1
AndreyBelym released this
v0.20.1 (2018-6-21)
⚙️
Typescript definitions for new features from v0.20.0 have been added (#2428)
Bug fixes
- Now sites with the overridden
Element.prototype.matches
method work properly #2241 window.Blob
now returns a correct result when Array ofArrayBuffer
is passed as a parameter (testcafe-hammerhead/#1599)- Firefox Shield popup is not shown during test execution now (#2421)
v0.20.1-alpha.1
AndreyBelym released this
Bump version (alpha) (#2422)
v0.20.0-alpha.4
AndreyBelym released this
0.20.0-alpha.4 (close #2384, close #2382, close #2070) (#2390)
v0.20.0-alpha.3
AndreyBelym released this
update hammerhead (#2368) * update hammerhead * bump version * Downgrade Edge version in client tests * renaming
v0.20.0-alpha.2
AndreyBelym released this
Bump version (alpha) (#2357)
v0.20.0-alpha.1
AndreyBelym released this
0.20.0-alpha.1 (#2328)
v0.19.2-alpha3
AndreyBelym released this
Bump version (alpha) (#2300)
v0.19.2-alpha2
AndreyBelym released this
0.19.2-alpha2 (#2283)
v0.19.2-alpha1
AndreyBelym released this
Update legacy api; Bump version (alpha) (#2269)
v0.19.2-dev20180323
AndreyBelym released this
0.19.2-dev20180323 (#2246)
v0.19.2-dev20180316
AndreyBelym released this
0.19.2-dev20180316 (close #2123) (#2223)
v0.19.1
AndreyBelym released this
v0.19.1 (2018-3-13)
Backward compatibility with the legacy test syntax has been restored (#2210)
Bug Fixes
- The
document.all
property is now overridden (testcafe-hammerhead/#1046) - Proxying properties in
async
class methods is now supported (testcafe-hammerhead/#1510) - Fixed wrong proxying of a
localStorage
check in WebWorkers (testcafe-hammerhead/#1510) - Function wrappers no longer break is-defined checks (testcafe-hammerhead/#1496)
v0.19.1-dev20180305
AndreyBelym released this
0.19.1-dev20180305 (#2192)
v0.19.0
AndreyBelym released this
v0.19.0 (2018-3-1)
TestCafe Live: See instant feedback when working on tests (#1624)
We have prepared a new tool for rapid test development.
TestCafe Live provides a service that keeps the TestCafe process and browsers opened the whole time you are working on tests. Changes you make in code immediately restart the tests. That is, TestCafe Live allows you to see test results instantly.
For more information, see TestCafe Live.
Enhancements
⚙️
Taking Screenshots of Individual Page Elements (#1496)
We have added the t.takeElementScreenshot action that allows you to take a screenshot of an individual page element.
import { Selector } from 'testcafe';
fixture `My fixture`
.page `http://devexpress.github.io/testcafe/example/`;
test('Take a screenshot of a fieldset', async t => {
await t
.click('#reusing-js-code')
.click('#continuous-integration-embedding')
.takeElementScreenshot(Selector('fieldset').nth(1), 'my-fixture/important-features.png');
});
This action provides additional customization that allows you to position the center of the screenshot or crop it. For more information, see the documentation.
Note that if the screenshot directory is not specified with the runner.screenshots API method or the screenshots command line option, the t.takeElementScreenshot
action will be ignored.
⚙️
Filtering Elements by Their Visibility (#1018)
You can now filter the selector's matching set to leave only visible or hidden elements. To do this, use the filterVisible and filterHidden methods.
import { Selector } from 'testcafe';
fixture `My fixture`
.page `http://devexpress.github.io/testcafe/example/`;
test('Filter visible and hidden elements', async t => {
const inputs = Selector('input');
const hiddenInput = inputs.filterHidden();
const visibleInputs = inputs.filterVisible();
await t
.expect(hiddenInput.count).eql(1)
.expect(visibleInputs.count).eql(11);
});
⚙️
Finding Elements by the Exact Matching Text (#1292)
The current selector's withText method looks for elements whose text content contains the specified string. With this release, we have added the withExactText method that performs search by strict match.
import { Selector } from 'testcafe';
fixture `My fixture`
.page `http://devexpress.github.io/testcafe/example/`;
test('Search by exact text', async t => {
const labels = Selector('label');
const winLabel = labels.withExactText('Windows');
const reusingLabel = labels.withText('JavaScript');
await t
.expect(winLabel.exists).ok()
.expect(reusingLabel.exists).ok();
});
⚙️
Using Decorators in TypeScript Code (#2117) by @pietrovich
TestCafe now allows you to use decorators when writing tests in TypeScript.
Note that decorators are still an experimental feature in TypeScript.
Bug Fixes
- TestCafe can now scroll a webpage when
body
has a scroll bar (#1940) - Firefox no longer hangs with a dialog asking to set it as the default browser (#1926)
- Legacy API no longer freezes because of an unexpected error (#1790)
- Click on an element that was hidden and then recreated on timeout now works correctly (#1994)
- TestCafe now correctly finds browsers in headless mode on macOS when tests are executing concurrently (#2035)
- When roles are switched using the
preserverUrl
flag, the local storage now restores correctly (#2015) - TestCafe progress bar is no longer visible on screenshots (#2076)
- Window manipulations now wait for page loading (#2000)
- All toolbars are now hidden when taking screenshots (#1445)
- TestCafe now works normally with the latest version of CucumberJS (#2107)
- Fixed an error connected to file permissions on Ubuntu (#2144)
- Browser manipulations can now be executed step-by-step (#2150)
- Fixed a bug where a page wouldn't load because of an error in
generateCallExpression
(testcafe-hammerhead/#1389) - Now the overridden Blob constructor doesn't process data unnecessarily (testcafe-hammerhead/#1359)
- Now the
target
attribute is not set for a button after a click on it (testcafe-hammerhead/#1437) - The
sandbox
,target
andstyle
attributes are now cleaned up (testcafe-hammerhead/#1448) - A
RangeError
with the messageMaximum call stack size exceeded
is no longer raised (testcafe-hammerhead/#1452) - A script error is no longer raised on pages that contain a
beforeunload
handler (testcafe-hammerhead/#1419) - Fixed wrong overridding of an event object (testcafe-hammerhead/#1445)
- Illegal invocation error is no longer raised when calling the
FileListWrapper.item
method (testcafe-hammerhead/#1446) by @javiercbk - A script error is no longer raised when
Node.nextSibling
isnull
(testcafe-hammerhead/#1469) - The
isShadowUIElement
check is now performed forNode.nextSibling
when a node is not an element (testcafe-hammerhead/#1465) - The
toString
function is now overridden for anchor elements (testcafe-hammerhead/#1483)
v0.19.0-alpha2
AndreyBelym released this
Bump version (alpha) (#2175)
v0.19.0-alpha1
AndreyBelym released this
Bump version (alpha) (#2138)
v0.18.7-dev20180206
AndreyBelym released this
Bump version (dev) (#2102) * Bump version (dev) * set firefox version
v0.18.7-dev20180201
AndreyBelym released this
Bump version (dev) (#2094)
v0.18.7-dev20180124
AlexanderMoskovkin released this
0.18.7-dev20180124 (close #1959) (#2068) * 0.18.7-dev20180124 * fix test
v0.18.7-dev20180117
AndreyBelym released this
0.18.7-dev20180117 (close #1897) (#2049)
0.18.7-dev20180112
AndreyBelym released this
update hammerhead and remove unnecessary util methods (#2041) * update hammerhead and remove unnecessary util methods * fix tests * update version
Watchers:174 |
Star:6233 |
Fork:344 |
创建时间: 2015-04-20 21:43:28 |
最后Commits: 4天前 |
许可协议:MIT |
8a7245f
Verified
v1.0.1 (2019-2-15)
Bug Fixes
ERR_STREAM_WRITE_AFTER_END
error after restarting tests in live mode (#3322)data-parsley-multiple
attribute (testcafe-hammerhead/#1845)headers
option of thefetch
function as an Array (testcafe-hammerhead/#1898)window.open
function (testcafe-hammerhead/#1908)