(量角器)检查单击时是否禁用了输入?

编程入门 行业动态 更新时间:2024-10-27 20:36:49
本文介绍了(量角器)检查单击时是否禁用了输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有两个输入字段,用户名和密码,以及一个微调按钮.当我单击此微调按钮时,这两个输入字段被禁用,我被重定向到另一个页面.我正在编写一个端到端测试,以检查这些输入字段是否被禁用.

I have two input fields, Username and Password and a spinner button. When i click on this spinner button these two input fields get disabled and I am redirected to another page. I am writing an end-to-end testing to check whether these input fields are disabled.

element(by.model('username')).sendKeys('rabi'); element(by.model('password')).sendKeys('rabi'); /* click on spin button */ spinBtn = element(by.className('call-to-action')); spinBtn.click(); /* check if input is disabled */ var loginInput = element(by.id('login-username')); expect(loginInput.isEnabled()).toBe(false);

推荐答案

上一个示例

expect(loginInput.getAttribute('disabled')).toEqual('disabled');

将无法检查是否启用了某些功能.

Will not work for checking if something is enabled.

您应该使用

expect(loginInput.isEnabled()).toBe([true|false]);

准确验证是否已启用/禁用某些功能.

to accurately verify if something is enabled/disabled.

如果这对您不起作用,则可能还有其他情况发生.

If that isn't working for you, there's probably something else going on.

更多推荐

(量角器)检查单击时是否禁用了输入?

本文发布于:2023-11-22 23:11:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619290.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:量角器   单击

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!