Javascript and Quality Assurance Engineer

►►unittesting

    objective:unittest can make the result of code clear to developer

    assertlibrary:mak sure the least unit way of normally running

    teststyle: TDD(Test Driven Development) && BDD(Behavior-DrivenDevelopment)


    ►►unitframework

        better-assert(TDDassert library)

        should.js(BDD)

        expect.js(BDD)

        chai.js(TDD&& BDD)

        Jasmine(BDD)

        node.jsitintegrate require(‘assert’)

        Intern(bigan complete unit test framework)

        Qunit(like jquery)

        Macaca(fromalibaba)

    

    ►►unit test procedure of running

        

    

    ►►automatedunit test

            karmaautomated runner integrate PhontomJs not refresh.

             Npm install -g karma

            npm install karma-cli –save-dev

            npm install karma-chrome-launcher –save-dev

            npm install karma-phantomjs-lancher –save-dev

            npm install karma-mocha –save-dev

            npm install karma-chai –save-dev

    

    ►►displaythe report of unit test Coverage rate

            npm install karma-coverage –save-dev

            coverageReport:{type:’html’,dir:‘coverage’}//setup result of code coverage rate

►►e2etesting

        Selenium-webdriver(Seleniumis a browser automation library. Most often used for testingweb-applications, Selenium may be         used for any task that requiresautomating interaction with the browser.)

                 npm install selenium-webdriver
            

           Usage(rememberthe download the driver Browser)

                The sample below and others are included in the example directory. Youmay also find the tests for selenium-webdriver             informative.

        const{Builder, By, Key, until} = require('selenium-webdriver');

            (asyncfunction example() {

                letdriver = await new Builder().forBrowser('firefox').build();

                try {

                    awaitdriver.get('http://www.google.com/ncr');

                    awaitdriver.findElement(By.name('q'));.sendKeys('webdriver',Key.RETURN);

                    await driver.wait(until.titleIs('webdriver - Google Search'), 1000);

                }finally {

                    await driver.quit();

                }

            })();

►►UI Testing

        npminstall -g backstopjs

        backstopinit

        backstoptest


►►performanceTesting

        benchmark(https://github.com/bestiejs/benchmark.js)

            ps:robust benchmarkinglibrary that supports high-resolution timers & returnsstatistically significant results. As seen                     on jsPerf.

        Usage:npm i --save benchmark


►►serverTesting

        npm install supertest –save-dev

        npm install mocha

        npm install mochawesome(thisis graphic componet base on mocha )


►►e2eTesting(baseon rize)

 npm install --save-dev puppeteer rize


►►f2etest















评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值