Path: blob/trunk/py/test/selenium/webdriver/common/repr_tests.py
1865 views
# Licensed to the Software Freedom Conservancy (SFC) under one1# or more contributor license agreements. See the NOTICE file2# distributed with this work for additional information3# regarding copyright ownership. The SFC licenses this file4# to you under the Apache License, Version 2.0 (the5# "License"); you may not use this file except in compliance6# with the License. You may obtain a copy of the License at7#8# http://www.apache.org/licenses/LICENSE-2.09#10# Unless required by applicable law or agreed to in writing,11# software distributed under the License is distributed on an12# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY13# KIND, either express or implied. See the License for the14# specific language governing permissions and limitations15# under the License.161718from selenium.webdriver.common.by import By19from selenium.webdriver.support.wait import WebDriverWait202122def test_should_implement_repr_for_web_driver(driver):23driver_repr = repr(driver)24assert type(driver).__name__ in driver_repr25assert driver.session_id in driver_repr262728def test_should_implement_repr_for_web_element(driver, pages):29pages.load("simpleTest.html")30elem = driver.find_element(By.ID, "validImgTag")31elem_repr = repr(elem)32assert type(elem).__name__ in elem_repr33assert driver.session_id in elem_repr34assert elem._id in elem_repr353637def test_should_implement_repr_for_wait(driver):38wait = WebDriverWait(driver, 30)39wait_repr = repr(wait)40assert type(wait).__name__ in wait_repr41assert driver.session_id in wait_repr424344