File indexing completed on 2024-09-08 05:10:05
0001 #!/usr/bin/env ruby 0002 # frozen_string_literal: true 0003 0004 # SPDX-License-Identifier: MIT 0005 # SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org> 0006 0007 require 'appium_lib' 0008 require 'minitest/autorun' 0009 0010 class TestKInfoCenter < Minitest::Test 0011 attr_reader :driver 0012 0013 def setup 0014 app = 'org.kde.kinfocenter.desktop' 0015 app = 'kinfocenter --platform xcb' if ENV['TEST_WITH_XWAYLAND'] 0016 @appium_driver = Appium::Driver.new( 0017 { 0018 'caps' => { app: app }, 0019 'appium_lib' => { 0020 server_url: 'http://127.0.0.1:4723', 0021 wait_timeout: 10, 0022 wait_interval: 0.5 0023 } 0024 }, true 0025 ) 0026 @driver = @appium_driver.start_driver 0027 end 0028 0029 def teardown 0030 driver.quit if driver 0031 end 0032 0033 def test_search 0034 search = driver.find_element(:name, 'Search') 0035 search.click 0036 search.send_keys('cpu') 0037 0038 cpu = driver.find_element(:class_name, '[list item | CPU]') 0039 assert(cpu.displayed?) 0040 cpu.click 0041 0042 cpu_tab = driver.find_element(:class_name, '[page tab | CPU]') 0043 assert(cpu_tab.displayed?) 0044 end 0045 end