【问题标题】:Make cypress type an empty space(spacebar) while holding shift按住 shift 时使 cypress 类型为空白(空格键)
【发布时间】:2020-06-20 10:54:30
【问题描述】:

我必须在自动完成菜单中键入,如果 cypress 键入空格键,它会关闭自动完成。

所以如果我想要的选项是“选项好”并且还有:“选项不好”和“选项不”

它将在第一个空格处退出菜单,并且不会让我继续输入我想要的选项。

我怎样才能做到这一点,而不是输入常规空格键,而是使用 shift+空格键呢?

谢谢。

【问题讨论】:

标签: cypress


【解决方案1】:

我是这样做的:

const currentProviderNameWords = currentProviderName.split(' ');
currentProviderNameWords.forEach((word, i) =>  {
  getAndLog(".mat-select-filter-input[placeholder='Suche']").type(word);
  if (i < currentProviderNameWords.length -1) getAndLog(".mat-select-filter-input[placeholder='Suche']").type("{shift} ");
});

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-15
    • 1970-01-01
    • 2016-07-15
    • 1970-01-01
    相关资源
    最近更新 更多