Coder Social home page Coder Social logo

dipjyotimetia / testcafetestframework Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.54 MB

WebUi testing using using testcafe

Home Page: https://dipjyotimetia.github.io/TestCafeTestFramework/

License: MIT License

TypeScript 82.63% Dockerfile 17.37%

testcafetestframework's Introduction

TestCafeCI

TestCafe WebUi Automation

Installation:

  • Install nodejs 12.6.2 lts Link
  • Install Vscode link

Project Setup:

  • git clone repo
  • npm install

Write Code:

  • Add new spec file with the format TC00*_SampleTest*_spec.js

Configure/update/set Test Environments:

Test:

  • test:chrome run tests in chrome browser

Generate Report Locally:

Built With

Configurations

.testcaferc.json

{
    "browsers": ["chrome","edge", "firefox"],
    "reporter": {
        "name": "xunit",
        "output": "reports/report.xml"
    },
    "screenshots": {
        "takeOnFails": true,
        "fullPage": true,
        "path": "screenshot",
        "pathPattern": "${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png"
    },
    "videoOptions": {
        "singleFile": true,
        "failedOnly": true,
        "pathPattern": "${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.mp4"
    },
    "debugMode": true,
    "debugOnFail": true,
    "skipJsErrors": true,
    "skipUncaughtErrors": true,
    "filter": {
        "test": "Click a label",
        "testGrep": "Click.*",
        "fixture": "Sample fixture",
        "fixtureGrep": "Page.*",
        "testMeta": {
            "device": "mobile",
            "env": "production"
        },
        "fixtureMeta": {
            "device": "mobile",
            "env": "production"
        }
    },
    "debugMode": false,
    "debugOnFail": false,
    "skipJsErrors": true,
    "skipUncaughtErrors": true,
    "appInitDelay": 3000,
    "concurrency": 1,
    "selectorTimeout": 3000,
    "assertionTimeout": 1000,
    "pageLoadTimeout": 1000,
    "hostname": "localhost",
    "developmentMode": false,
    "tsConfigPath": "tsconfig.json",
    "disablePageCaching": true,
    "color": true,
    "appCommand": "node server.js",
    "speed": 0.1,
    "proxy": "proxy.corp.mycompany.com",
    "ssl": {
        "pfx": "path/to/file.pfx",
        "rejectUnauthorized": true
    }
}

runnerConfig

.filter((testName, fixtureName, fixturePath, testMeta, fixtureMeta) => {
    return fixturePath.startsWith('D') &&
        testName.match(someRe) &&
        fixtureName.match(anotherRe) &&
        testMeta.mobile === 'true' &&
        fixtureMeta.env === 'staging';
});

.browsers(['chrome', 'firefox'])
.browsers('chrome:headless')
.browsers('chrome:headless --no-sandbox --disable-gpu')
.concurrency(3);

.screenshots({
    path: 'reports/screenshots/',
    takeOnFails: true,
    pathPattern: '${DATE}_${TIME}/test-${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.png'
});


.video('reports/videos/', {
    singleFile: true,
    failedOnly: true,
    pathPattern: '${TEST_INDEX}/${USERAGENT}/${FILE_INDEX}.mp4'
}, {
    r: 20,
    aspect: '4:3'
});

testcafetestframework's People

Contributors

dependabot[bot] avatar dipjyotimetia avatar dependabot-preview[bot] avatar

Stargazers

Roman avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.