This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const crypto = require('crypto'); | |
function hashFile (file, algorithm = 'sha512', encoding = 'base64', options) { | |
return new Promise((resolve, reject) => { | |
const hash = crypto.createHash(algorithm); | |
hash.on('error', reject).setEncoding(encoding); | |
fs.createReadStream( | |
file, | |
Object.assign({}, options, { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Selector, t } from 'testcafe'; | |
fixture `New Fixture` | |
.page `http://localhost:3000/` | |
.beforeEach(async t => { | |
await t | |
.typeText('#username', 'Tavares_Barrows') | |
.typeText('#password', 's3cret') | |
.click(Selector('main span').withText('SIGN IN')) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Selector, t } from 'testcafe'; | |
fixture `New Fixture` | |
.page `http://localhost:3000/` | |
.beforeEach(async t => { | |
await t | |
.typeText('#username', 'Tavares_Barrows') | |
.typeText('#password', 's3cret') | |
.click(Selector('main span').withText('SIGN IN')) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Selector } from 'testcafe'; | |
fixture`A set of examples that illustrate how to use TestCafe API` | |
.page`http://devexpress.github.io/testcafe/example/`; | |
const developerName = Selector('#developer-name'); | |
const triedLabel = Selector('label').withText('I have tried TestCafe'); | |
const sliderHandle = Selector('#slider').child('span'); | |
const submitButton = Selector('#submit-button'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RequestMock } from 'testcafe'; | |
const mock = RequestMock() | |
.onRequestTo((request) => { | |
return request.url === 'http://localhost:3000/' && request.method === 'get'; | |
}) | |
.respond((req, res) => { | |
res.statusCode = 200; | |
res.headers = { | |
'content-type': 'application/json', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"originFile": 123 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
<button id="button">CLICK ME!</button> | |
<script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var fs = require('fs'); | |
var app = express(); | |
app.get('/page', function (req, res) { | |
res.setHeader('content-type', 'text/html'); | |
res.send(fs.readFileSync('./index.html')); | |
}); | |
app.get('/', function (req, res) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Selector} from 'testcafe'; | |
const label = Selector('label'); | |
class Feature { | |
label: Selector; | |
checkbox: Selector; | |
constructor(text) { | |
this.label = label.withText(text); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from 'http'; | |
const lazyImport = require('import-lazy')(require); | |
const browserTools = lazyImport('testcafe-browser-tools'); | |
const endpointUtils = lazyImport('endpoint-utils'); | |
const GUID_TITLE = '7cae8e73-44eb-49d8-a275-62a333e6172f'; | |
const WATCH_BROWSER_PAGE = ` |
NewerOlder