2.1.25-alpha.0 • Published 6 months ago

@syngrisi/syngrisi-wdio-sdk v2.1.25-alpha.0

Weekly downloads
10
License
ISC
Repository
github
Last release
6 months ago

SDK for Syngrisi tool

Base Flow Overview

There is 3 basic step for particular test: syngrisi flow

Installation

npm i @syngrisi/syngrisi-wdio-sdk --save-dev

Usage Example

const syngrisi = require('@syngrisi/syngrisi-wdio-sdk');
const vrsHost = 'localhost';
const vrsPort = 3000;
const VRSConfig = { url: `http://${vrsHost}:${vrsPort}/` };
const { remote } = require('webdriverio');

;(async () => {
    global.browser = await remote({
        capabilities: { browserName: 'chrome' }
    })
    // 0. Add Syngrisi driver to browser object
    browser.vDriver = new syngrisi.vDriver(VRSConfig);

    // 1. Start Syngrisi test session
    await browser.vDriver.startTestSession({
        app: 'Test Application',
        test: 'My first Syngrisi test',
        suite: 'My first Syngrisi suite'
    });

    await browser.navigateTo('https://www.google.com/ncr')

    // 2.1. perform visual check
    const screenshot = new Buffer(await browser.takeScreenshot(), 'base64');

    await browser.vDriver.checkSnapshot(
        'My Check',
        screenshot
    );

    const searchInput = await browser.$('[name=q]');
    await searchInput.setValue('Σύγκριση');

    const searchBtn = await browser.$('input[value="Google Search"]');
    await (searchBtn.waitForClickable())
    await searchBtn.click();

    // 2.2 perform another visual check
    const screenshot2 = new Buffer(await browser.takeScreenshot(), 'base64');

    await browser.vDriver.checkSnapshot(
        'My another Check',
        screenshot2
    );

    // 2.3 stop test Session
    await browser.vDriver.stopTestSession();

})().catch((err) => {
    log.error(err)
    throw err
}).finally(() => browser.deleteSession());

Environment variables

RUN_NAME - use such variable to set up specific run name, by default it will generate automatically ENV_POSTFIX - will add to platform property, you can use this to set some unique platform name for particular environment SYNGRISI_LOG_LEVEL - logging level ("trace" | "debug" | "info" | "warn" | "error")

SDK API

vDriver class

  • vDriver(cfg) (constructor) - initialize vDriver instance
Parameters
NameTypeDetails
cfgobjecte.g.: {url: 'http://localhost:3000'}
  • startTestSession(params) - starts of the test session
Parameters
NameTypeDetails
paramsobjecte.g: {app: 'App Name', test: 'Test Name',suite: 'Suite Name'}
  • checkSnapshot(checkName, imageBuffer, domDump) - create snapshot and send to Syngrisi API
Parameters
NameTypeDetails
checkNameStringeg.: 'Check Name'
imageBufferBufferFile buffer
domDumpStringWeb Page DOM Dump JSON string, to get properly dump use getDomDump() method
  • stopTestSession() - stop of the test session
2.1.21-alpha.0

6 months ago

2.1.20-alpha.0

6 months ago

2.0.4

7 months ago

2.0.1

7 months ago

2.1.25-alpha.0

6 months ago

2.1.22-alpha.0

6 months ago

2.1.23-alpha.0

6 months ago

2.1.24-alpha.0

6 months ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.18

2 years ago

1.2.16

2 years ago

1.2.17

2 years ago

1.2.15

2 years ago

1.2.14

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.9

2 years ago

1.2.12

2 years ago

1.2.13

2 years ago

1.2.10

2 years ago

1.2.11

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7-f

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago