Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // -- test name = "set_the_icon_of_btn" -- //
- local test_count, test_name, user_name, output_dir
- on openCard
- put "desktop1_atmosk" into user_name
- put "set_the_icon_of_btn" into test_name
- put "F:/LiveCode/Scripts/output.txt" into output_dir
- put 0 into test_count
- if the environment is "development" then exit openCard
- send SetupTest to me in 500 milliseconds
- end openCard
- command SetupTest
- if exists(btn 1) then
- send Testing to me in 500 milliseconds
- exit SetupTest
- end if
- set the width of templateButton to 50
- set the height of templateButton to 50
- lock screen
- repeat with y = 0 to 9 times
- repeat with x = 0 to 9 times
- set the left of templateButton to x*50
- set the top of templateButton to y*50
- create btn
- end repeat
- end repeat
- unlock screen
- send Testing to me in 500 milliseconds
- end SetupTest
- command Testing
- add 1 to test_count
- get AppendToOutput(TestingItem())
- if test_count < 5 then
- send Testing to me in 500 milliseconds
- exit Testing
- end if
- if the environment is "development" then exit Testing
- quit
- end Testing
- function TestingItem
- put 210002 into icon1
- put 210001 into icon2
- put 100000 into repeat_count
- put 100 into normal_count
- put 1000 into lockscreen_count
- --repeat time
- set the backgroundcolor of this card to "128,238,238"
- put the milliseconds into repeat_milliseconds
- repeat with i = 1 to repeat_count times
- if icon_icon is icon1 then
- put icon2 into icon_icon
- else
- put icon1 into icon_icon
- end if
- put trunc(i/normal_count)*normal_count into count_offset
- end repeat
- put the milliseconds - repeat_milliseconds into repeat_milliseconds
- set the backgroundcolor of this card to "238,238,238"
- --normal time
- set the backgroundcolor of this card to "238,128,238"
- put the milliseconds into normal_milliseconds
- repeat with i = 1 to normal_count times
- if icon_icon is icon1 then
- put icon2 into icon_icon
- else
- put icon1 into icon_icon
- end if
- put i - (trunc((i-1)/normal_count)*normal_count) into offset_i
- set the icon of btn offset_i to icon_icon
- end repeat
- put the milliseconds - normal_milliseconds into normal_milliseconds
- set the backgroundcolor of this card to "238,238,238"
- --lockscreen time
- put 0 into lockscreen_milliseconds
- repeat with n = 1 to (lockscreen_count/normal_count)
- set the backgroundcolor of this card to "238,238,128"
- lock screen
- put the milliseconds into inner_lockscreen_milliseconds
- repeat with i = 1 to lockscreen_count times
- if icon_icon is icon1 then
- put icon2 into icon_icon
- else
- put icon1 into icon_icon
- end if
- put i - (trunc((i-1)/normal_count)*normal_count) into offset_i
- set the icon of btn offset_i to icon_icon
- end repeat
- add the milliseconds - inner_lockscreen_milliseconds to lockscreen_milliseconds
- unlock screen
- set the backgroundcolor of this card to "238,238,238"
- end repeat
- put normal_milliseconds-((repeat_milliseconds/repeat_count)*normal_count) into normal_milliseconds
- put lockscreen_milliseconds-((repeat_milliseconds/repeat_count)*lockscreen_count) into lockscreen_milliseconds
- return normal_milliseconds/normal_count & tab & lockscreen_milliseconds/lockscreen_count
- end TestingItem
- function AppendToOutput output
- put user_name & tab & platform() & tab & systemVersion() & tab & environment() & tab & version() & tab & test_name & tab into infos
- put output_dir into dir
- put url("file:" & dir) into input
- if (input is not empty) then put cr after input
- put input & infos & output into url("file:" & dir)
- end AppendToOutput
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement