Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperexecute Integrations #2874

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Hyperexecute
on:
workflow_dispatch:
inputs:
username:
required: true
description: LT Username
accessKey:
description: LT Access Key
required: true
sampleRepoLink:
description: Link to the HyperExecute sample repo
default: https://github.com/gauravchawhan/mathjs
required: true
jobs:
HyperExecute-Playwright:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [windows-latest]
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Starting CLI testing
shell: bash
run: |
echo "STEP 1 ) Downloading sample suite"
git clone https://github.com/gauravchawhan/mathjs
echo "STEP 2) Download CLI and setting environment variables"
cd mathjs
curl https://downloads.lambdatest.com/hyperexecute/windows/hyperexecute.exe -o hyperexecute.exe
export LT_USERNAME=${{ github.event.inputs.username }}
export LT_ACCESS_KEY=${{ github.event.inputs.accessKey }}
echo $LT_USERNAME
echo $LT_ACCESS_KEY
./hyperexecute --user $LT_USERNAME --key $LT_ACCESS_KEY --config hyperexecute.yaml
32 changes: 32 additions & 0 deletions hyperexecute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
version: 0.1
runson: win # defines the OS to test on

concurrency: 1 # number of machines to execute the testcases
autosplit: true

# pre steps sets up the environment for testing
pre:
- npm install
- npm install karma -g
- npm install -g karma-jasmine
- npm install karma-safari-launcher -g
- npm install karma-webdriver-launcher -g
- npm i karma-mocha -g
- npm i karma-webpack -g
- npm i mocha -g


# Smart cache
cacheKey: '{{ checksum "package-lock.json" }}'
cacheDirectories:
- node_modules

# testDiscovery is used to discover all the test cases in test/unit-tests folder
testDiscovery:
type: raw
mode: dynamic
command: grep -nri 'describe' test/unit-tests -ir --include=*.test.js | sed 's/:.*//'

# command to execute the test cases
testRunnerCommand: karma start test/browser-test-config/lt_karma.js --spec= $test
70 changes: 70 additions & 0 deletions test/browser-test-config/lt_karma.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
var fs = require('fs');
const baseKarma = require('./base-karma')
const mochaConfig = require('../../.mocharc.json')
const webpack = require('webpack')


module.exports = function(config) {
var webdriverConfig = {
hostname: 'hub.lambdatest.com', //lambdatest hub address
port: 80
}

const baseConfig = baseKarma(config)

config.set(Object.assign(baseConfig, {
hostname: '127.0.0.1', // hostname, where karma web server will run
port: 9876,
basePath: '../..',
frameworks: ['mocha'],


client: {
mocha: {
timeout: mochaConfig.timeout
}
},
files: [
'test/browser-test-config/browser-tests.test.js'
],

plugins: [

'karma-webpack',
'karma-mocha',

'karma-webdriver-launcher',

],

captureTimeout: 600000,
retryLimit: 1,
browserDisconnectTimeout: 90000,
browserDisconnectTolerance: 1,
browserNoActivityTimeout: 90000,

concurrency: 1,
logLevel: config.LOG_DEBUG,
browsers: ['Windows_Chrome'],
customLaunchers: {
'Windows_Chrome': {
base: 'WebDriver',
config: webdriverConfig,
browserName: 'chrome',
version: 'latest',
build: 'OSS',
name: 'Jos MathJs',
video: true, // capture video for your test
visual: true, // capture screenshots on each step
network: true, // capture network logs for your test
console: true, // capture browser console logs
terminal: true,
user: process.env.LT_USERNAME,
accessKey: process.env.LT_ACCESS_KEY,
pseudoActivityInterval: 15000 // 5000 ms heartbeat
}
},
singleRun: true,
autoWatch: true
}));
};