Skip to content

Instantly share code, notes, and snippets.

View AlexanderMoskovkin's full-sized avatar

Alexander Moskovkin AlexanderMoskovkin

View GitHub Profile
#7206
IHT Date <date> On Track / IHT Date Slipped to <revised date> due <reason>
#xxx - done
#xxx - done
Achieved today:
xxx
Expecting tomorrow:
xxx
Impediments:
xxx
[
{
"cat": "Консервы и соленья",
"name": "Говядина Гродфуд тушеная",
"price": 262,
"link": "https://sbermarket.ru/metro/goviadina-tushienaia-grodfud?sid=176",
"volume": "338 г",
"brand": "Гродфуд",
"manufacturer": null,
"country": "Беларусь",
@AlexanderMoskovkin
AlexanderMoskovkin / Case1.testcafe
Created February 26, 2020 11:40
TestCafe Studio Roles using (Case 1)
{"fixtures":[{"name":"Roles Demo","pageUrl":"https://reportse2e.iszolea.net/","tests":[{"name":"Case 1","commands":[{"callsite":"0","expression":"var tc = require('testcafe');\r\nvar Role = tc.Role;\r\nvar Selector = tc.Selector;\r\n\r\nvar RoleHelper = require('./role-helper-1');\r\n\r\nawait t.useRole(RoleHelper.getEmptyRole(Selector, Role));","studio":{},"type":"execute-async-expression"}]}]}]}
// UI/Layout Stuff
- Switch naming. It should be:
"Reports Manager"
"Applications Menu Builder"
Reports Manager:
- Add Item button should have the following subitems: "Folder", "Grid", "Dashboard"
// UI Functionality
All editors in the Edit Item area should have labels (like "Permissions", "Connection", "Table")
@AlexanderMoskovkin
AlexanderMoskovkin / role.ts
Created March 28, 2018 08:29
[Stack Overflow Question] Define testcafe userrole in typescript
import { Role, t } from 'testcafe';
export const UserRole: Role = Role('https://github.com/login', async (t) => {
await t
.typeText('#login_field', '<my-login>')
.typeText('#password', '<my-password>')
.click('input[value="Sign in"]');
}, { preserveUrl: true });
class Page1 {
constructor () {
this.input = Selector('.page1-input');
}
}
class Page2 {
constructor () {
this.input = Selector('.page2-input');
}

Hi @thireven,

After some considetaion let's stay with the following API:

-p or --screenshot-path-pattern

testcafe chrome test.js -s <path> -p "${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png"
@AlexanderMoskovkin
AlexanderMoskovkin / shadow-dom-test.js
Created January 10, 2018 09:53
TestCafe with ShadowDOM example
import { Selector } from 'testcafe';
fixture `Shadow DOM Example`
.page `https://jsfiddle.net/txyamhcj/`;
test('Type inside shadowDOM', async t => {
const outputIframe = Selector('iframe').withAttribute('name', 'result');
const shadowInput = Selector(() => document.querySelector('#host').shadowRoot.querySelector('#txtTest'));
await t
@AlexanderMoskovkin
AlexanderMoskovkin / index.js
Created December 13, 2017 05:36
make request
import request from 'request';
const getResponseStatusCode = link => {
return new Promise(resolve => {
request(link, function (error, response, body) {
console.log('error:', error); // Print the error if one occurred
console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
console.log('body:', body); // Print the HTML for the Google homepage.
resolve(response && response.statusCode);
@AlexanderMoskovkin
AlexanderMoskovkin / test.js
Created December 5, 2017 16:34
An example how you can test DevExpress ASP controls with TestCafe
import { Selector } from 'testcafe';
fixture `DX Controls`
.page `https://demos.devexpress.com/aspxgridviewdemos/GridEditing/EditModes.aspx`;
const ComboBox = class {
constructor (id) {
this.id = id;
this.dropDownBtn = Selector(`#${id}_B-1`);