Skip to content

Instantly share code, notes, and snippets.

View stoefln's full-sized avatar

Stephan Petzl stoefln

View GitHub Profile
static async execCommandMain(
command,
input,
quitOnStringFound,
consoleLog = line => {
console.debug(line)
},
directory,
replaceStrings
) {
//...
tryRead = minicapClient => {
this.log('tryRead')
var outgoingImage
for (var chunk; (chunk = minicapClient.read()); ) {
//console.info('chunk(length=%d)', chunk.length)
for (var cursor = 0, len = chunk.length; cursor < len; ) {
if (this.readBannerBytes < this.bannerLength) {
@stoefln
stoefln / DropShotsTest.kt
Last active October 24, 2022 14:25
DropShotsTest.kt
class MyTest {
@get:Rule
val activityScenarioRule = ActivityScenarioRule(TestActivity::class.java)
@get:Rule
val dropshots = Dropshots()
@Before
fun setup() {
// Setup your activity however you like
@stoefln
stoefln / repeato-example.js
Last active October 13, 2022 15:25
configure testRunner to rename screenshots
// after each test run, insert ".assertion" into the filename of screenshots which have been taken during an "Assertion" AKA "Check content" step
// this way all screenshots EXCEPT assertion screenshots could be ignored with .gitignore directive:
// *screenshot.jpg
// !*screenshot.assertion.jpg
const renameScreenshots = function(testRun){
testRun.stepResults.forEach((sr) => {
if (sr.step.isAssertionStep) {
const screenshotPath = testRun.getScreenshotPathByStepId(sr.step.id)
const newFilenpath = screenshotPath.replace(".jpg", ".assertion.jpg")
//@ts-check
const exec = require('child_process').exec
import Shell from './Shell'
import DeviceData from '../models/DeviceData'
import sleep from '../utils/sleep'
import log from 'loglevel'
import { sendEvent } from './Analytics'
import { MissingServiceError } from './Errors'
function MiniTouchError(message) {
repeato-studio git:(feature/test-cases-for-build) npm run test:build
> Repeato@1.0.0-beta.26 test:build /Users/steph/Workspace/repeato-studio
> cross-env NODE_ENV=development cross-env TEST_BUILD=true npx playwright test --config=app/test/config/default.config.js
Using config at /Users/steph/Workspace/repeato-studio/app/test/config/default.config.js
DeletingDir app/test/temp/emptyWorkspace
Using UI Store at app/test/temp/emptyWorkspace/ui-database.rpt
DeletingDir app/test/temp/emptyWorkspace
Using UI Store at app/test/temp/emptyWorkspace/ui-database.rpt
PS C:\Users\steph\repeato-studio> npm i
> node-native-ocr@0.2.0 install C:\Users\steph\repeato-studio\node_modules\node-native-ocr
> npm run build-tesseract && node-gyp rebuild
> node-native-ocr@0.2.0 build-tesseract C:\Users\steph\repeato-studio\node_modules\node-native-ocr
> node ./scripts/build-tesseract
build-tesseract script start.
npm run test:build
> Repeato@1.0.0-beta.26 test:build /Users/steph/Workspace/repeato-studio
> cross-env NODE_ENV=development cross-env TEST_BUILD=true npx playwright test --config=app/test/config/default.config.js
Using config at /Users/steph/Workspace/repeato-studio/app/test/config/default.config.js
Using UI Store at app/test/temp/emptyWorkspace/ui-database.rpt
DeletingDir app/test/temp/emptyWorkspace
Using UI Store at app/test/temp/emptyWorkspace/ui-database.rpt
@Test
fun clickIncrementButton_counterUpdated() {
// The counterScreen block is a top-level function that you need to implement in your robot
counterScreen {
given {
// make sure counter is reset
resetCounter()
}
perform {
// launch Activity
0 verbose cli [
0 verbose cli '/Users/steph/.nvm/versions/node/v12.20.0/bin/node',
0 verbose cli '/Users/steph/.nvm/versions/node/v12.20.0/bin/npm',
0 verbose cli 'i',
0 verbose cli 'node-native-ocr',
0 verbose cli '--save'
0 verbose cli ]
1 info using npm@7.8.0
2 info using node@v12.20.0
3 timing npm:load:whichnode Completed in 1ms