Skip to content

Feat/performance test #850

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

Animesh404
Copy link
Contributor

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 (#704 (comment)) and outcomes are saved in test_results.txt

Checklist

  • My code follows the style guidelines of OpenAdapt
  • I have performed a self-review of my code
  • If applicable, I have added tests to prove my fix is functional/effective
  • I have linted my code locally prior to submission
  • 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 Animesh404 changed the title Feature/performance test Feat/performance test Jul 12, 2024
@@ -0,0 +1,49 @@
"""This module provides platform-specific implementations for window and element
interactions using accessibility APIs. It abstracts the platform differences
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unnecessary indent

from . import _macos as impl

role = "AXStaticText"
elif sys.platform in ("win32", "linux"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove linux for now

@abrichr
Copy link
Member

abrichr commented Jul 15, 2024

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants