Skip to content

getProperty() Method Implemented#52

Merged
vimscientist69 merged 3 commits intomasterfrom
feat/get-property-method
Aug 13, 2025
Merged

getProperty() Method Implemented#52
vimscientist69 merged 3 commits intomasterfrom
feat/get-property-method

Conversation

@vimscientist69
Copy link

@vimscientist69 vimscientist69 commented Aug 13, 2025

Reason

Reason for creating this pull request: fixes #51

Tech Details List

  1. Update Driver and WebDriver protocols to have a getProperty() method with element and property name arguments.
  2. Implement getProperty() method for ChromeDriver, using the execute() method to get the property value using JavaScript
  3. Write working integration tests to test getProperty() method; by first setting an attribute to a new value and then getting the new value with getProperty() and checking if the value is the same as what it has been set to with setAttribute()

Tasks:

  • Update Driver and WebDriver protocols to have a getProperty() method with element and property name arguments.
  • Implement getProperty() method for ChromeDriver, using the execute() method to get the property value using JavaScript
  • Write working integration tests to test getProperty() method; by first setting an attribute to a new value and then getting the new value with getProperty() and checking if the value is the same as what it has been set to with setAttribute()

Un-important tasks:

Links:

ISSUE-51
closes/resolves #51

Testing

Steps:

  1. Run required commands to test all the code modified by this PR
# unit tests
# integration tests
npm run compose:build-and-up
swift test --filter "ChromeDriverSetAttributeIntegrationTests"
# procs / testing logic
  1. Further testing can be done by following the notes in TESTING-QA

Output:

╰─❯ swift test --filter "ChromeDriverSetAttributeIntegrationTests"
❯ swift test --filter "ChromeDriverSetAttributeIntegrationTests"

[1/1] Planning build
Building for debugging...
[4/4] Emitting module SwiftWebDriverIntegrationTests
Build complete! (2.06s)
Test Suite 'Selected tests' started at 2025-08-13 09:36:35.691.
Test Suite 'swift-webdriverPackageTests.xctest' started at 2025-08-13 09:36:35.698.
Test Suite 'swift-webdriverPackageTests.xctest' passed at 2025-08-13 09:36:35.698.
         Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.000) seconds
Test Suite 'Selected tests' passed at 2025-08-13 09:36:35.698.
         Executed 0 tests, with 0 failures (0 unexpected) in 0.000 (0.007) seconds
◇ Test run started.
↳ Testing Library Version: 124.4
↳ Target Platform: arm64e-apple-macos14.0
◇ Suite "Chrome Driver Set Attribute" started.
◇ Test "Set Attribute" started.
✔ Test "Set Attribute" passed after 2.542 seconds.
✔ Suite "Chrome Driver Set Attribute" passed after 2.543 seconds.
✔ Test run with 1 test passed after 2.543 seconds.

Testing QA

Make sure to run all required services for integration tests with docker-compose before running the integration tests.

written integration tests, tests passed as expected
…ve value of an element property by using JavaScript

Selenium WebDriver API does note have a way to get the live value of an attribute, like an updated value of an input element. The only way to get the live value would be to use JavaScript. That is what the `getProperty()` method does. Integration tests written for this method, and passed as expected.
@vimscientist69 vimscientist69 self-assigned this Aug 13, 2025
@vimscientist69 vimscientist69 merged commit 584d107 into master Aug 13, 2025
1 of 2 checks passed
@vimscientist69 vimscientist69 deleted the feat/get-property-method branch August 13, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature -> getProperty() method

1 participant