Skip to content

Commit

Permalink
DOM-44732 updating clear_input after antd version update (#311)
Browse files Browse the repository at this point in the history
Removing the if-statement since after the clear() is called, the "value"
attribute comes up as "".

Also adding a COMMAND + BACKSPACE command since CONTROL did not work
anymore. Having these extra commands does not affect the browser and if
they're not needed, just results in a no op.
  • Loading branch information
ddl-joy-liao authored Feb 24, 2023
1 parent 28e3a2e commit 508506c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ _Get your repo setup using cucu as a test framework_
1. install and start Docker if you haven't already
2. add cucu your `requirements.txt` to get from GH by label (use current label number)
```
git+ssh://[email protected]/cerebrotech/cucu@0.116.0#egg=cucu
git+ssh://[email protected]/cerebrotech/cucu@0.118.0#egg=cucu
```
3. install it
```
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cucu"
version = "0.117.0"
version = "0.118.0"
license = "MIT"
description = ""
authors = ["Rodney Gomes <[email protected]>"]
Expand Down
15 changes: 9 additions & 6 deletions src/cucu/steps/input_steps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import humanize
import sys

from cucu import helpers, fuzzy, retry, step

Expand Down Expand Up @@ -65,13 +66,15 @@ def clear_input(input_):
"""
input_.clear()

if input_.get_attribute("value") != "":
# Keys.CONTROL works on both laptops and through the Selenium grid;
# Keys.COMMAND works on laptop, but not on Selenium grid,
# and actually causes an active session on the grid to hang,
# so we can safely use only the Keys.CONTROL sequence.
# Keys.CONTROL works on the Selenium grid (when running in CI)
# - it stopped working on laptop after the upgrade in antd version (Feb 2023)
# Keys.COMMAND works on laptop, but not on Selenium grid,
# and actually causes an active session on the grid to hang.
if "darwin" in sys.platform:
input_.send_keys(Keys.COMMAND, "a")
else:
input_.send_keys(Keys.CONTROL, "a")
input_.send_keys(Keys.BACKSPACE)
input_.send_keys(Keys.BACKSPACE)


def find_n_write(ctx, name, value, index=0):
Expand Down

0 comments on commit 508506c

Please sign in to comment.