|
|
|
import pytest |
|
import time |
|
import json |
|
from selenium import webdriver |
|
from selenium.webdriver.common.by import By |
|
from selenium.webdriver.common.action_chains import ActionChains |
|
from selenium.webdriver.support import expected_conditions |
|
from selenium.webdriver.support.wait import WebDriverWait |
|
from selenium.webdriver.common.keys import Keys |
|
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities |
|
|
|
class TestRent(): |
|
def setup_method(self, method): |
|
options = webdriver.FirefoxOptions() |
|
options.add_argument('--headless=false') |
|
self.driver = webdriver.Remote(command_executor='http://localhost:4444/wd/hub', options=options) |
|
|
|
def teardown_method(self, method): |
|
self.driver.quit() |
|
|
|
def test_rent(self): |
|
|
|
|
|
|
|
self.driver.get("https://rentmasseur.com/") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-1873612555 > .button").click() |
|
|
|
self.driver.set_window_size(1309, 753) |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".navbar-column > .jsx-2001960601:nth-child(1) > .navigation-link-text").click() |
|
|
|
self.driver.find_element(By.ID, "email").click() |
|
|
|
self.driver.find_element(By.ID, "email").send_keys("Karpathianwolf") |
|
|
|
self.driver.find_element(By.ID, "email").send_keys(Keys.ENTER) |
|
|
|
self.driver.find_element(By.ID, "password").click() |
|
|
|
self.driver.find_element(By.ID, "password").send_keys("Lola369!") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".switch").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-1345806167 > .button").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".status-icon-green").click() |
|
|
|
element = self.driver.find_element(By.CSS_SELECTOR, ".navigation-link > .icon-available") |
|
actions = ActionChains(self.driver) |
|
actions.move_to_element(element).perform() |
|
|
|
element = self.driver.find_element(By.CSS_SELECTOR, "body") |
|
actions = ActionChains(self.driver) |
|
actions.move_to_element(element, 0, 0).perform() |
|
|
|
dropdown = self.driver.find_element(By.CSS_SELECTOR, ".has-width-50per:nth-child(2) > .jsx-2753549060 > .jsx-2753549060") |
|
dropdown.find_element(By.XPATH, "//option[. = '6 Hours']").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-2753549060:nth-child(6)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-2753549060 > .button").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-1820926561 > .item-hover").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,110)") |
|
|
|
self.driver.find_element(By.LINK_TEXT, "My Interview").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,0)") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-3552218322:nth-child(5) > .jsx-3552218322 > .jsx-2745941253").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".option:nth-child(1)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".is-justify-content-end").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-3552218322:nth-child(6) .jsx-2745941253 > .jsx-2745941253").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".option:nth-child(1)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".is-justify-content-end").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,550)") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-3552218322:nth-child(7) .jsx-2745941253 > .jsx-2745941253").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".option:nth-child(1)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".is-justify-content-end").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,129)") |
|
|
|
self.driver.find_element(By.LINK_TEXT, "Photos").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".Photos").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".has-cursor-pointer:nth-child(5) .edit-photo").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,0)") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".icon-font:nth-child(4)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".has-cursor-pointer:nth-child(4) .edit-photo").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,0)") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".icon-font:nth-child(4)").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,349)") |
|
|
|
self.driver.find_element(By.LINK_TEXT, "My Blog").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,0)") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-2674725205:nth-child(7) .jsx-2745941253 > .jsx-2745941253").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-2745941253 > .jsx-2674725205:nth-child(1)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".button-container").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,1392)") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-2674725205:nth-child(8) .jsx-2745941253 > .jsx-2745941253").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-2745941253 > .jsx-2674725205:nth-child(1)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".button-container").click() |
|
|
|
self.driver.execute_script("window.scrollTo(0,1392)") |
|
|
|
self.driver.find_element(By.LINK_TEXT, "Massages & Rates").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(5) > .jsx-200115206 > .jsx-200115206 > .jsx-200115206:nth-child(1) > .jsx-200115206:nth-child(2)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(5) > .jsx-200115206 > .jsx-200115206 > .jsx-200115206:nth-child(1) > .jsx-200115206:nth-child(2)").send_keys("239") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(5) .jsx-200115206:nth-child(2) > .jsx-200115206:nth-child(2)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(5) .jsx-200115206:nth-child(2) > .jsx-200115206:nth-child(2)").send_keys("279") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(3) > .jsx-200115206 > .jsx-200115206 > .jsx-200115206:nth-child(1) > .jsx-200115206:nth-child(2)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(3) > .jsx-200115206 > .jsx-200115206 > .jsx-200115206:nth-child(1) > .jsx-200115206:nth-child(2)").send_keys("239") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(3) .jsx-200115206:nth-child(2) > .jsx-200115206:nth-child(2)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(3) .jsx-200115206:nth-child(2) > .jsx-200115206:nth-child(2)").send_keys("269") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(2) > .jsx-200115206 > .jsx-200115206 > .jsx-200115206:nth-child(1) > .jsx-200115206:nth-child(2)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(2) > .jsx-200115206 > .jsx-200115206 > .jsx-200115206:nth-child(1) > .jsx-200115206:nth-child(2)").send_keys("233") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(2) > .jsx-200115206 > .jsx-200115206 > .jsx-200115206:nth-child(2) > .jsx-200115206:nth-child(2)").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".jsx-200115206:nth-child(2) > .jsx-200115206 > .jsx-200115206 > .jsx-200115206:nth-child(2) > .jsx-200115206:nth-child(2)").send_keys("269") |
|
|
|
self.driver.find_element(By.NAME, "incallPrice").click() |
|
|
|
self.driver.find_element(By.NAME, "incallPrice").send_keys("230") |
|
|
|
self.driver.find_element(By.NAME, "outcallPrice").click() |
|
|
|
self.driver.find_element(By.NAME, "outcallPrice").send_keys("269") |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".Rates").click() |
|
|
|
self.driver.find_element(By.CSS_SELECTOR, ".is-justify-content-flex-end > .jsx-1644775375").click() |
|
|
|
|