Skip to content

Instantly share code, notes, and snippets.

@mgrybyk
mgrybyk / compare.js
Last active June 6, 2019 23:22
compare webdriver.json and jsonwp.json
/* eslint-disable no-console */
const request = require('request')
const appiumJson = require('../packages/webdriver/protocol/appium.json')
const jsonwpJson = require('../packages/webdriver/protocol/jsonwp.json')
const mjsonwpJson = require('../packages/webdriver/protocol/mjsonwp.json')
const webdriverJson = require('../packages/webdriver/protocol/webdriver.json')
const url = 'https://raw.githubusercontent.com/appium/appium-base-driver/master/lib/protocol/routes.js'
let errors = 0
@mgrybyk
mgrybyk / copy-packages.js
Last active September 10, 2019 14:06
copy wdio packages
/**
* Copies webdriverio packages
*
* 1. Create file in `webdriverio` project root folder and run it;
* 2. Specify path to your working project;
* 3. Run script `node copy-packages.js`
*/
const path = require('path')
const fse = require('fs-extra')
@mgrybyk
mgrybyk / podbot.md
Created November 11, 2019 20:47 — forked from matheusagcosta/podbot.md
Podbot Counter Strike 1.6 on Mac OSX

1 - Make sure you have Counter Strike installed

2 - Download YAPB http://forums.bots-united.com/showthread.php?t=9986

3 - Extract the zip and move the folder addons with all the content to ~/Library/Application Support/Steam/steamapps/common/Half-Life/cstrike

4 - After that, open the file liblist.gam in the folder above and replace gamedll_osx "dlls/cs.dylib" with this content:

//gamedll_osx "dlls/cs.dylib"
@mgrybyk
mgrybyk / get performance metrics
Last active December 18, 2019 01:13
selenium v4 CDP
import org.junit.jupiter.api.Test;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.devtools.DevTools;
import org.openqa.selenium.devtools.performance.Performance;
class MySeleniumTest {
static final String CHROMEDRIVER_PATH = "/Users/m/sources/ag/e2e/node_modules/selenium-standalone/.selenium/chromedriver/79.0.3945.36-x64-chromedriver";
@Test
void myTest() {
@mgrybyk
mgrybyk / ArrayList
Last active October 10, 2020 16:19
Data Structures
// please don't use it! It's just a draft that contains defects and is not fully implemented!
class ArrayList {
constructor (initialSize = 16) {
this._initialSize = initialSize
this._threshold = initialSize
this._size = 0
this._bucket = new Array(initialSize)
}
@mgrybyk
mgrybyk / solution.ts
Last active January 15, 2020 22:38
2D server grid update
/**
* Calculate days required to update all servers
*
* O(rows * columns)
*
* @param rows rows in grid array
* @param columns columns in grid array
* @param grid servers 2D array
*
* @returns days required to update all servers or -1 if it's not possible
@mgrybyk
mgrybyk / general.ini
Last active April 14, 2023 12:07
GeForce Now - Witcher 3 - enable console
[General]
ConfigVersion=2
DBGConsoleOn=true
pipeline {
agent any
options {
timeout(time: 20, unit: 'MINUTES')
buildDiscarder(logRotator(numToKeepStr: '300'))
}
parameters {
booleanParam(
@mgrybyk
mgrybyk / datepicker.js
Last active February 4, 2022 01:06
WebdriverIO snippets
const lang = 'en'
describe('element ui date picker', () => {
it('set current date +60 days', () => {
browser.url('https://element.eleme.io/#/en-US/component/date-picker')
const datePickerInput = $('.el-date-editor>input')
expect(datePickerInput).toBeClickable()
const datePicker = new DatePickerElement(datePickerInput)
@mgrybyk
mgrybyk / compiled_proxy.js
Last active February 4, 2022 01:15
WebdriverIO - new async api
// proxy.ts after compilation
async function p$(selector) {
return pElementFactory.call(this, selector)
}
async function shadow$(selector) {
return pElementFactory.call(this, selector)
}
async function p$$(selector) {
return [pElementFactory.call(this, selector, 0), pElementFactory.call(this, selector, 1)]