<commit_before>require 'calabash-android/calabash_steps'
require 'pry'

Then(/^I should see issued movement "(.*?)"$/) do |number|
    unless (element_exists("android.widget.TextView id:'tv_issued' text:'#{number}'"))
		fail(msg="not found #{number}")
	end
end

Then(/^I should see inventory "(.*?)"$/) do |number|
    unless (element_exists("android.widget.TextView id:'tv_inventory' text:'#{number}'"))
		fail(msg="not found #{number}")
	end
end

And(/^I enter regimen totals$/) do
    while !query("android.widget.EditText id:'et_total' text:''").empty?
        query("android.widget.EditText id:'et_total'", {:setText => '1'})
    end

    steps %Q{
        Then I scroll "scrollView" down to "Submit for Approval"
    }

    while !query("android.widget.EditText id:'et_total' text:''").empty?
        query("android.widget.EditText id:'et_total'", {:setText => '1'})
    end
end

And(/^I add custom regimens and enter total$/) do
    steps %Q{
        Then I press "+ Adult regime"
        Then I wait for "Selected regime already exists" to appear
        And I select one drug to create a adult regime
        Then I press "Next"

        Then I wait for "MMIA" to appear
        And I enter regimen totals

        Then I press "+ Child regime"
        Then I wait for "Selected regime already exists" to appear
        And I select one drug to create a baby regime
        Then I press "Next"

        Then I wait for "MMIA" to appear
        And I enter regimen totals
    }
end
<commit_msg>LHX && WSZ - #802 - fix the function Test<commit_after>require 'calabash-android/calabash_steps'
require 'pry'

Then(/^I should see issued movement "(.*?)"$/) do |number|
    unless (element_exists("android.widget.TextView id:'tv_issued' text:'#{number}'"))
		fail(msg="not found #{number}")
	end
end

Then(/^I should see inventory "(.*?)"$/) do |number|
    unless (element_exists("android.widget.TextView id:'tv_inventory' text:'#{number}'"))
		fail(msg="not found #{number}")
	end
end

And(/^I enter regimen totals$/) do
    while !query("android.widget.EditText id:'et_total' text:''").empty?
        query("android.widget.EditText id:'et_total'", {:setText => '1'})
    end

    steps %Q{
        Then I scroll "scrollView" down to "Submit for Approval"
    }

    while !query("android.widget.EditText id:'et_total' text:''").empty?
        query("android.widget.EditText id:'et_total'", {:setText => '1'})
    end
end

And(/^I add custom regimens and enter total$/) do
    steps %Q{
        Then I press "+ Adult regime"
        Then I wait for "Create regime" to appear
        And I select one drug to create a adult regime
        Then I press "Next"

        Then I wait for "MMIA" to appear
        And I enter regimen totals

        Then I press "+ Child regime"
        Then I wait for "Create regime" to appear
        And I select one drug to create a baby regime
        Then I press "Next"

        Then I wait for "MMIA" to appear
        And I enter regimen totals
    }
end

{'fraction_non_alphanumeric': 0.1304202801867912, 'fraction_numerical': 0.0023348899266177454, 'mean_word_length': 2.988031914893617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1367748', 'n_tokens_mistral': 931, 'n_tokens_neox': 908, 'n_words': 328}