<commit_before>require 'spec_helper'

describe Uia::Element do
  Given(:element) { Uia.find_element(id: 'MainFormWindow') }
  Given(:about_box) { Uia.find_element(id: 'AboutBox') }
  Given { element.as(:window).visual_state = :normal }

  context 'properties' do
    let(:raw_element) { element.instance_variable_get(:@element) }
    Then { element.handle != 0 }
    Then { element.name == 'MainFormWindow' }
    Then { element.id == 'MainFormWindow' }
    Then { element.class_name =~ /Forms.*app/i }
    Then { expect(element.find(id: 'textField')).to be_enabled }

    context 'visibility' do
      When { element.as(:window).visual_state = :minimized }
      Then { element.visible? == false }
    end

    context '#control_type' do<commit_msg>wait for :about_box in element spec<commit_after>require 'spec_helper'

describe Uia::Element do
  Given(:element) { Uia.find_element(id: 'MainFormWindow') }
  Given(:about_box) { wait_until { Uia.find_element(id: 'AboutBox') } }
  Given { element.as(:window).visual_state = :normal }

  context 'properties' do
    let(:raw_element) { element.instance_variable_get(:@element) }
    Then { element.handle != 0 }
    Then { element.name == 'MainFormWindow' }
    Then { element.id == 'MainFormWindow' }
    Then { element.class_name =~ /Forms.*app/i }
    Then { expect(element.find(id: 'textField')).to be_enabled }

    context 'visibility' do
      When { element.as(:window).visual_state = :minimized }
      Then { element.visible? == false }
    end

    context '#control_type' do
{'fraction_non_alphanumeric': 0.14397394136807817, 'fraction_numerical': 0.0013029315960912053, 'mean_word_length': 3.876190476190476, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2099110', 'n_tokens_mistral': 506, 'n_tokens_neox': 491, 'n_words': 101}