Skip to content

Commit

Permalink
Get the boilerplate working
Browse files Browse the repository at this point in the history
  • Loading branch information
spectranaut committed May 1, 2024
1 parent 6b1d1f4 commit df5ff2b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 13 deletions.
9 changes: 4 additions & 5 deletions resources/testdriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -1080,9 +1080,8 @@
* @returns {Promise} Fullfilled with object representing accessibilty node
* rejected in the cases of failures
*/
get_accessibility_api_node: async function(id) {
let node = await window.test_driver_internal.get_accessibility_api_node(id);
return node;
get_accessibility_api_node: function(dom_id) {
return window.test_driver_internal.get_accessibility_api_node(dom_id);
}
};

Expand Down Expand Up @@ -1273,8 +1272,8 @@
throw new Error("clear_device_posture() is not implemented by testdriver-vendor.js");
},

async get_accessibility_api_node(id) {
throw new Error("not implemented, whoops!");
async get_accessibility_api_node(dom_id) {
throw new Error("not implemented, whoops!");
}
};
})();
5 changes: 2 additions & 3 deletions tools/wptrunner/wptrunner/executors/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,8 @@ def __init__(self, logger, protocol):
self.protocol = protocol

def __call__(self, payload):
id = payload["id"]
self.logger.debug(f"Getting accessibility API node for: {id} ------------")
return self.protocol.platform_accessibility.get_accessibility_api_node(id)
dom_id = payload["dom_id"]
return self.protocol.platform_accessibility.get_accessibility_api_node(dom_id)


actions = [ClickAction,
Expand Down
2 changes: 1 addition & 1 deletion tools/wptrunner/wptrunner/executors/executorwebdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class WebDriverPlatformAccessibilityProtocolPart(PlatformAccessibilityProtocolPa
def setup(self):
self.webdriver = self.parent.webdriver

def get_computed_label(self, id):
def get_accessibility_api_node(self, id):
# Is this where the magic should happen?
return "Test"

Expand Down
2 changes: 1 addition & 1 deletion tools/wptrunner/wptrunner/executors/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ class PlatformAccessibilityProtocolPart(ProtocolPart):
name = "platform_accessibility"

@abstractmethod
def get_accessibility_api_node(self, id):
def get_accessibility_api_node(self, dom_id):
"""Return the the platform accessibilty object.
:param id: DOM ID."""
Expand Down
5 changes: 2 additions & 3 deletions tools/wptrunner/wptrunner/testdriver-extra.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,8 +336,7 @@
return create_action("clear_device_posture", {context});
};

window.test_driver_internal.get_accessibility_api_node = function(id) {
console.log("the id is: ", id);
return create_action("get_accessibility_api_node", {id});
window.test_driver_internal.get_accessibility_api_node = function(dom_id) {
return create_action("get_accessibility_api_node", {dom_id});
};
})();

0 comments on commit df5ff2b

Please sign in to comment.