Path: blob/trunk/py/test/selenium/webdriver/common/bidi_session_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.window import WindowTypes202122@pytest.mark.xfail_safari23def test_session_status(driver):24result = driver._session.status()25assert result is not None26assert "ready" in result27assert "message" in result28assert isinstance(result["ready"], bool)29assert isinstance(result["message"], str)303132@pytest.mark.xfail_safari33def test_session_status_not_closed_with_one_window(driver):34# initial session status35initial_status = driver._session.status()36assert initial_status is not None3738# Open new window and tab39driver.switch_to.new_window(WindowTypes.WINDOW)40driver.switch_to.new_window(WindowTypes.TAB)4142# Close one window43driver.close()4445# Session should still be active46status_after_closing = driver._session.status()47assert status_after_closing is not None48assert "ready" in status_after_closing49assert "message" in status_after_closing505152