def get_mobile_size(mobileToTest, orientation): """ Return mobile size from file Configuration/MobileTesting.json with wanted orientation. :param mobileToTest: :param orientation: :return: """ cl = ConfigLoader(file="MobileTesting.json", mobileConfig=True) size = cl.get(mobileToTest).split("*") firstSize = int(size[0]) secondSize = int(size[1]) if orientation == "Portrait": if firstSize > secondSize: x = secondSize y = firstSize else: x = firstSize y = secondSize elif orientation == "Landscape": if firstSize > secondSize: x = firstSize y = secondSize else: x = secondSize y = firstSize else: raise Exception( "Allowed orientation is Portrait and Landscape. Forwarded orientation is {}" .format(orientation)) return {"width": x, "height": y}
from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log from Lib.temasekproperties.HomePage import HomePage from Lib.temasekproperties.Listings import Listings from Lib.temasekproperties.LogIn import LogIn from Lib.temasekproperties.Resources import Resources cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() driver.get("https://temasekproperties.com/wp-login.php") log = Log(driver) li = LogIn(driver) li.log_in("TestBS", "test123") hp = HomePage(driver) hp.go_to_resources_booking() #hp.go_to_listings() rb = Resources(driver) #l.search_for("Derbyshire") rb.book("Central - Newton", "Derbyshire #22-01") bookedFor = rb.booking_steps() hp.go_to_resources_booked() rb.check_if_exist("6 Derbyshire #22-01", bookedFor)
from Lib.SgPano.Dashboard import Dashboard from Lib.SgPano.EditProfile import EditProfile from Lib.SgPano.HomePage import HomePage from Lib.SgPano.LogIn import LogIn from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() log = Log(driver) driver.get("https://sgpano.com/") hp = HomePage(driver) hp.go_to_log_in() lp = LogIn(driver) lp.log_in(cl.get("usernameTrial"), cl.get("passwordTrial")) db = Dashboard(driver) db.go_to_edit_profile() epp = EditProfile(driver) epp.edit_profile(cl.get("editName"), cl.get("editContact"), cl.get("editEmail"), cl.get("editDescription"))
import time from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log from Lib.temasekproperties.HomePage import HomePage from Lib.temasekproperties.Listings import Listings from Lib.temasekproperties.LogIn import LogIn cl = ConfigLoader() createDriver = DriverData(driver="Chrome") driver = createDriver.get_driver() driver.get("https://temasekproperties.com/wp-login.php") log = Log(driver) li = LogIn(driver) li.log_in("testagent", "test123") hp = HomePage(driver) hp.go_to_listings() l = Listings(driver) l.change_page(cl.get("purchaseListingPage")) l.open_listing_by_index(cl.get("purchaseListingIndex")) l.purchase_listing("Monthly", "*****@*****.**", "firstName", "lastName", cl.get("purchaseListingPayPalEmail"), cl.get("purchaseListingPayPalPassword"))
from Lib.SgPano.HomePage import HomePage from Lib.SgPano.SignUp import SignUp from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() log = Log(driver) driver.get("https://sgpano.com/") hp = HomePage(driver) hp.go_to_sign_up() sup = SignUp(driver) sup.open_trial_panotour() sup.sign_up_trial(cl.get("usernameTrial"), cl.get("passwordTrial"), cl.get("emailTrial"))
from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log from Lib.temasekproperties.LogIn import LogIn from Lib.temasekproperties.RegistrationAgent import RegistrationAgent cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() driver.get("https://temasekproperties.com/wp-login.php") log = Log(driver) li = LogIn(driver) li.go_to_sign_up() ra = RegistrationAgent(driver) ra.sign_up(cl.get("signUpFirstName"), cl.get("signUpLastName"), cl.get("signUpCEA"), cl.get("signUpMobile"))
import time from Lib.SgPano.CreateEditTourConnectScenes import ConnectScenesTour from Lib.SgPano.CreateEditTourBasicInformation import BasicInformationTour from Lib.SgPano.CreateEditTourUploadedScenes import UploadedScenesTour from Lib.SgPano.Dashboard import Dashboard from Lib.SgPano.EditScenes import EditScenes from Lib.SgPano.HomePage import HomePage from Lib.SgPano.LogIn import LogIn from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.NonAppSpecific import check_if_elem_exist from Lib.common.ScenesGetData import parse_to_scenes from Lib.common.WaitAction import wait_until cl = ConfigLoader() pictures_info2 = cl.get("picturesData") scenes = parse_to_scenes(pictures_info2) createDriver = DriverData() driver = createDriver.get_driver() driver.get("https://sgpano.com/") hp = HomePage(driver) time.sleep(2) hp.go_to_log_in() time.sleep(2) lp = LogIn(driver) lp.log_in(cl.get("usernameTrial"), cl.get("passwordTrial"))
from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log from Lib.temasekproperties.HomePage import HomePage from Lib.temasekproperties.LogIn import LogIn from Lib.temasekproperties.UserProfile import UserProfile cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() driver.get("https://temasekproperties.com/wp-login.php") log = Log(driver) li = LogIn(driver) li.log_in("testagent", "test123") hp = HomePage(driver) hp.go_to_user_profile() up = UserProfile(driver) up.edit_info(cl.get("updateProfileFirstName"), cl.get("updateProfileLastName"), cl.get("updateProfileEmail"), cl.get("updateProfileMobile"))
from Lib.SgPano.HomePage import HomePage from Lib.SgPano.LogIn import LogIn from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() log = Log(driver) url = "https://sgpano.com/" log.info("Go to {}".format(url)) driver.get(url) hp = HomePage(driver) hp.go_to_log_in() lp = LogIn(driver) lp.log_in(cl.get("usernameTrial"), cl.get("passwordTrial"))
from Lib.SgPano.HomePage import HomePage from Lib.SgPano.SignUp import SignUp from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() log = Log(driver) driver.get("https://sgpano.com/") hp = HomePage(driver) hp.go_to_sign_up() su = SignUp(driver) su.open_basic_panotour() su.sign_up_paid(cl.get("usernameBasic"), cl.get("passwordBasic"), cl.get("emailBasic"), cl.get("payPalEmail"), cl.get("payPalPassword"))
from Lib.SgPano.Dashboard import Dashboard from Lib.SgPano.EditScenes import EditScenes from Lib.SgPano.HomePage import HomePage from Lib.SgPano.LogIn import LogIn from Lib.SgPano.ViewTour import ViewTour from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log from Lib.common.ScenesGetData import parse_to_scenes cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() log = Log(driver) driver.get("https://sgpano.com/") hp = HomePage(driver) hp.go_to_log_in() lp = LogIn(driver) lp.log_in(cl.get("usernameTrial"), cl.get("passwordTrial")) db = Dashboard(driver) db.view_edit_tour() es = EditScenes(driver) es.view_tour_by_name(cl.get("tourName")) vt = ViewTour(driver) pictures_info = cl.get("picturesData")
from Lib.SgPano.Dashboard import Dashboard from Lib.SgPano.EditScenes import EditScenes from Lib.SgPano.HomePage import HomePage from Lib.SgPano.LogIn import LogIn from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() log = Log(driver) driver.get("https://sgpano.com/") hp = HomePage(driver) hp.go_to_log_in() lp = LogIn(driver) lp.log_in(cl.get("usernameTrial"), cl.get("passwordTrial")) db = Dashboard(driver) db.view_edit_tour() es = EditScenes(driver) es.remove_tour_by_name(cl.get("tourName")+" edited")
import time from Lib.SgPano.CreateEditTourBasicInformation import BasicInformationTour from Lib.SgPano.CreateEditTourConnectScenes import ConnectScenesTour from Lib.SgPano.CreateEditTourUploadScenes import UploadScenesTour from Lib.SgPano.CreateEditTourUploadedScenes import UploadedScenesTour from Lib.SgPano.Dashboard import Dashboard from Lib.SgPano.EditScenes import EditScenes from Lib.SgPano.HomePage import HomePage from Lib.SgPano.LogIn import LogIn from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log from Lib.common.ScenesGetData import parse_to_scenes cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() log = Log(createDriver) driver.get("https://sgpano.com/") hp = HomePage(driver) hp.go_to_log_in() lp = LogIn(driver) lp.log_in(cl.get("usernameTrial"), cl.get("passwordTrial")) db = Dashboard(driver) db.view_edit_tour()
from Lib.SgPano.CreateEditTourBasicInformation import BasicInformationTour from Lib.SgPano.CreateEditTourUploadScenes import UploadScenesTour from Lib.SgPano.CreateEditTourUploadedScenes import UploadedScenesTour from Lib.SgPano.Dashboard import Dashboard from Lib.SgPano.HomePage import HomePage from Lib.SgPano.LogIn import LogIn from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.ScenesGetData import parse_to_scenes cl = ConfigLoader() ##upload scenes createDriver1 = DriverData(driver="Firefox") driverTemp = createDriver1.get_driver() driverTemp.get("https://sgpano.com/") #log = Log(createDriver1) hp1 = HomePage(driverTemp) hp1.go_to_log_in() lp1 = LogIn(driverTemp) lp1.log_in(cl.get("usernameTrial"), cl.get("passwordTrial")) db1 = Dashboard(driverTemp) db1.create_new_tour() bit1 = BasicInformationTour(driverTemp) bit1.set_basic_info(title=cl.get("tourName"), address=cl.get("tourAddress"), description=cl.get("tourDescription"), publicAccess=False)
from Lib.SgPano.HomePage import HomePage from Lib.SgPano.LogIn import LogIn from Lib.common.ConfigLoader import ConfigLoader from Lib.common.DriverData import DriverData from Lib.common.Log import Log cl = ConfigLoader() createDriver = DriverData() driver = createDriver.get_driver() log = Log(driver) url = "https://sgpano.com/" log.info("Go to {}".format(url)) driver.get(url) hp = HomePage(driver) hp.go_to_log_in() ln = LogIn(driver) ln.log_in_social_media(cl.get("facebookEmail"), cl.get("facebookPass"))