OpenAdapt icon indicating copy to clipboard operation
OpenAdapt copied to clipboard

Feat/performance test

Open Animesh404 opened this issue 1 year ago • 1 comments

What kind of change does this PR introduce?

Performance test for #704 Summary

This is a WIP PR for issue #704. Conducted both the performance test as per (https://github.com/OpenAdaptAI/OpenAdapt/issues/704#issuecomment-2158842920) and outcomes are saved in test_results.txt

Checklist

  • [x] My code follows the style guidelines of OpenAdapt
  • [x] I have performed a self-review of my code
  • [x] If applicable, I have added tests to prove my fix is functional/effective
  • [x] I have linted my code locally prior to submission
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation (e.g. README.md, requirements.txt)
  • [ ] New and existing unit tests pass locally with my changes

How can your code be run and tested?

pytest test_performance.py

Other information

Animesh404 avatar Jul 12 '24 18:07 Animesh404

Let's add the simple spreadsheet task:

  • record inserting the word "hello in cell B2
  • replay with instructions enter the word 'goodbye' in cell D5

I believe evaluating on MacOS won't work because Excel for Mac does not appear to contain accessibility data. A workaround for this is to use AppleScript:

tell application "Microsoft Excel"
	set activeSheet to active sheet of active workbook
	set dataRange to used range of activeSheet
	set dataList to {}
	
	set rowCount to count rows of dataRange
	set colCount to count columns of dataRange
	
	repeat with r from 1 to rowCount
		repeat with c from 1 to colCount
			set theCell to cell (r) of column (c) of dataRange
			set cellValue to value of theCell
			if cellValue is missing value then set cellValue to "Empty"
			
			-- Use address of the cell to determine location
			set cellAddress to get address of theCell
			
			-- Optionally split address to extract row and column numbers
			set cellData to {cellValue, cellAddress}
			copy cellData to the end of dataList
		end repeat
	end repeat
	
	return dataList
end tell

abrichr avatar Jul 15 '24 17:07 abrichr