diff options
Diffstat (limited to 'appiumtests')
| -rw-r--r-- | appiumtests/Readme.md | 14 | ||||
| -rwxr-xr-x | appiumtests/dolphintest.py | 32 |
2 files changed, 45 insertions, 1 deletions
diff --git a/appiumtests/Readme.md b/appiumtests/Readme.md index eac841e58..4409d1cca 100644 --- a/appiumtests/Readme.md +++ b/appiumtests/Readme.md @@ -1,7 +1,19 @@ -Instructions: +# Instructions: +```bash chmod u+x dolphintest.py +``` + +```bash python3 -m venv .venv +``` + +```bash source .venv/bin/activate +``` + +```bash selenium-webdriver-at-spi-run ./dolphintest.py +``` + diff --git a/appiumtests/dolphintest.py b/appiumtests/dolphintest.py index f0df3941e..2f1d3c6bf 100755 --- a/appiumtests/dolphintest.py +++ b/appiumtests/dolphintest.py @@ -95,6 +95,38 @@ class DolphinTests(unittest.TestCase): self.assertEqual(len(elements), 2) self.assertEqual(elements[0].text, "test1.txt") self.assertEqual(elements[1].text, "test2.txt") + + def test_3_autovalidate_url(self): + dolphinBackground = self.driver.find_element( + by=AppiumBy.ACCESSIBILITY_ID, + value="DolphinViewContainer.DolphinView.KItemListContainer" + ) + + editButton = self.driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value="KUrlNavigatorToggleButton") + editButton.click() + + # clear contents + clearButton = self.driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value="DolphinUrlNavigator.KUrlComboBox.KLineEdit.QLineEditIconButton") + clearButton.click() + + locationBar = self.driver.find_element(by=AppiumBy.ACCESSIBILITY_ID, value="DolphinUrlNavigator.KUrlComboBox.KLineEdit") + locationBar.send_keys("{}/testDir".format(os.environ["HOME"])) + + # Move to the bottom right at 50px of the border to ensure not clicking on items + rect = dolphinBackground.rect + x = rect['width'] - 50 + y = rect['height'] - 50 + + actions = ActionChains(self.driver) + actions.move_to_element_with_offset(dolphinBackground, x, y).click().perform() + + # Check if the button visible on edit mode has been hidden + self.assertFalse(clearButton.is_displayed()) + + elements = self.driver.find_elements(by=AppiumBy.XPATH, value="//table_cell") + self.assertEqual(len(elements), 2) + self.assertEqual(elements[0].text, "test1.txt") + self.assertEqual(elements[1].text, "test2.txt") """ |
