故意重复的步骤

时间:2019-06-06 14:54:18

标签: getgauge

对于我正在编写的一种情况,我有两个不同的步骤可以执行相同的操作:

* Click "R$ "

但是,在运行压力表时会出现错误:

Failed Step: Click "R$ "
        Specification: specs/example.spec:10
        Error Message: Error: Element matching text "R$ " is covered by other element
        Stacktrace: 
        Error: Element matching text "R$ " is covered by other element
            at _click (node_modules/taiko/lib/taiko.js:715:15)

如何故意添加重复的步骤?

这是我的完整情况:

* Login at "localhost:8001", as "user" and password "pass"
* Goto "localhost:8004/page/status"
* Check if text "Status page" exists on page
* Click "R$ "
* Check if text "Edit status" exists on page
* Click "R$ "
* Change value to "5"

* Click "R$ "实现是(与source相同):

step("Click <selector>", async function(selector) {
    await click(selector);
});

1 个答案:

答案 0 :(得分:0)

在规格中允许重复步骤。但是您面临的错误是太鼓。因此,请检查您尝试单击的元素是否被其他任何元素覆盖。