Path: blob/trunk/py/test/selenium/webdriver/common/opacity_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.1617import pytest1819from selenium.webdriver.common.by import By202122@pytest.mark.xfail_ie23def test_should_be_able_to_click_on_elements_with_opacity_zero(driver, pages):24pages.load("click_jacker.html")25element = driver.find_element(By.ID, "clickJacker")26assert "0" == element.value_of_css_property("opacity"), (27"Precondition failed: clickJacker should be transparent.\28Value was %s"29% element.value_of_css_property("opacity")30)31element.click()32assert "1" == element.value_of_css_property("opacity")333435@pytest.mark.xfail_ie36def test_should_be_able_to_select_options_from_an_invisible_select(driver, pages):37pages.load("formPage.html")38select = driver.find_element(By.ID, "invisi_select")39options = select.find_elements(By.TAG_NAME, "option")40apples = options[0]41oranges = options[1]4243assert apples.is_selected()44assert not oranges.is_selected()4546oranges.click()47assert not apples.is_selected()48assert oranges.is_selected()495051