Skip to content

Instantly share code, notes, and snippets.

View AlexanderMoskovkin's full-sized avatar

Alexander Moskovkin AlexanderMoskovkin

View GitHub Profile
class C1 {
fn2() {
}
someFn () {
this.fn2();
}
}
class C2 {
// вся логика по массиву комманд тут
export default class CommandExecutor {
constructor (testRun) {
this.testRun = testRun;
}
execute (commands) {
return new Promise((resolve, reject) => {
test.commands.forEach(command => testRun.addTestCommand(command));
testRun.addTestCommand(createDoneCommand());
@AlexanderMoskovkin
AlexanderMoskovkin / index
Created April 15, 2016 08:50
Drag Commands
drag
arguments:
selector
dragOffsetX
dragOffsetY
options: { offsetX, offsetY, modifiers: { ctrl, alt, shift, meta } }
possible errors:
- Action selector is expected to be a string, but it was <code>${err.actualType}</code>.
- The specified selector does not match any element in the DOM tree.
function waitForIframeReloaded (iframe) {
return new Promise(function (resolve) {
iframe.contentWindow.addEventListener('unload', resolve);
})
.then(function () {
return window.QUnitGlobals.waitForIframe(iframe);
});
}
function wait (ms) {
import ActionIntegerArgumentError;
import ActionPositiveIntegerArgumentError;
function integer () {
}
function positiveInteger () {
}
class Driver () {
executeCommand (command) {}
executeCommandInIframe(command, iframe) {
var iframeDriverAdapter = new DriverAdapter(iframe);
iframeDriverAdapter.executeCommand(command);
}
}
set VS_WEB_EXTERNAL_PATH="C:\Program Files (x86)\Microsoft Visual Studio 14.0\Web\External"
set PATH=%PATH%;%VS_WEB_EXTERNAL_PATH%
set PATH=%PATH%;%VS_WEB_EXTERNAL_PATH%\git
set SAUCE_USERNAME_FUNCTIONAL_DESKTOP=testcafe-func
set SAUCE_ACCESS_KEY_FUNCTIONAL_DESKTOP=rEtherU8
cd C:\
mkdir testcafe-test-functional-legacy
cd testcafe-test-functional-legacy
git clone https://github.com/DevExpress/testcafe.git --branch master --depth 1
start /wait /b npm install

Numerous useful features

With TestCafe, you have unlimited capabilities when creating functional tests. Everything you need in a single tool:

@AlexanderMoskovkin
AlexanderMoskovkin / new.js
Last active December 29, 2016 14:03
Compare old and new api
test(`set custom navigation`, async t => {
const progress = Selector('#surveyProgress');
const prevDisplay = Selector('#surveyPrev').getStyleProperty('display');
const nextDisplay = Selector('#surveyNext').getStyleProperty('display');
const completeDisplay = Selector('#surveyComplete').getStyleProperty('display');
const progressDisplay = progress.getStyleProperty('display');
await t
.click(`#set_custom_navigation`)
@AlexanderMoskovkin
AlexanderMoskovkin / login.js
Last active January 11, 2017 11:07
Share login code between files
export default function login (t) {
await t
.navigateTo('http://your-login-page') // if necessary
.typeText('login-input-selector', 'login')
.typeText('password-input-selector', 'password')
.click('submit-btn-selector');
}