繁体   English   中英

执行前显示的测试结果-黄瓜/角

[英]Test results shown before it executes - Cucumber/Angular

我是黄瓜新手。 执行前会显示我的测试结果。 即使浏览器仍在加载,它也会显示所有通过的信息。

以下是我的* page.js

var CalculatorPage = function() {
    //const {setDefaultTimeout} = require('cucumber');
    this.get = function() {
        browser.get('');
    };

下面是我的steps.js文件

this.Given(/^The LoginPage is open$/, function () {
    this.page.get();
});

这是因为JavaScript以异步方式执行。 为了使其同步,我们需要利用promise。

var CalculatorPage = function() {
    //const {setDefaultTimeout} = require('cucumber');
    this.get = function() {
       return browser.get('');
    };

this.Given(/^The LoginPage is open$/, function (done) {
    this.page.get().then(function(){
        done()
    });
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM