Path: blob/trunk/py/test/selenium/webdriver/common/opacity_tests.py
3991 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"), (27f"Precondition failed: clickJacker should be transparent.\28Value was {element.value_of_css_property('opacity')}"29)30element.click()31assert "1" == element.value_of_css_property("opacity")323334@pytest.mark.xfail_ie35def test_should_be_able_to_select_options_from_an_invisible_select(driver, pages):36pages.load("formPage.html")37select = driver.find_element(By.ID, "invisi_select")38options = select.find_elements(By.TAG_NAME, "option")39apples = options[0]40oranges = options[1]4142assert apples.is_selected()43assert not oranges.is_selected()4445oranges.click()46assert not apples.is_selected()47assert oranges.is_selected()484950