Skip to content

Commit b4f6ca3

Browse files
committed
Revert fix for isKeyed test
* Revert fix for isKeyed test. Part of separate pull request.
1 parent 7a3eef3 commit b4f6ca3

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

webdriver-ts/src/isKeyed.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ window.nonKeyedDetector_reset = function() {
4343
window.nonKeyedDetector_tradded = [];
4444
window.nonKeyedDetector_trremoved = [];
4545
window.nonKeyedDetector_removedStoredTr = [];
46-
window.trToBeRemoved = null;
4746
}
4847
4948
window.nonKeyedDetector_setUseShadowDom = function(useShadowDom ) {
@@ -72,9 +71,7 @@ window.nonKeyedDetector_instrument = function() {
7271
let trs = [];
7372
nodeList.forEach(n => {
7473
if (n.tagName==='TR') {
75-
if (!trToBeRemoved || trToBeRemoved !== n) {
76-
trs.push(n);
77-
}
74+
trs.push(n);
7875
trs = trs.concat(filterTRInNodeList(n.childNodes));
7976
}
8077
});
@@ -118,14 +115,6 @@ window.nonKeyedDetector_storeTr = function() {
118115
}
119116
window.storedTr = node.querySelector('tr:nth-child(2)');
120117
}
121-
window.markTrAsToBeRemoved = function(indexOfTr) {
122-
trToBeRemoved = document.querySelector('table'); // <table>
123-
124-
if (trToBeRemoved) {
125-
trToBeRemoved = trToBeRemoved.children[0]; // <tbody>
126-
trToBeRemoved = trToBeRemoved.children[indexOfTr]; // <tr> list
127-
}
128-
}
129118
window.nonKeyedDetector_reset();
130119
`;
131120

@@ -303,9 +292,6 @@ async function runBench(frameworkNames: string[]) {
303292
await driver.executeScript("nonKeyedDetector_storeTr()");
304293
let text = await getTextByXPath(driver, `//tbody/tr[2]/td[2]/a`, false);
305294
await driver.executeScript("window.nonKeyedDetector_reset()");
306-
if (!keyedRun) {
307-
await driver.executeScript("window.markTrAsToBeRemoved(999)");
308-
}
309295
await clickElementByXPath(driver, `//tbody/tr[2]/td[3]/a/span[1]`, false);
310296
await testTextNotContained(driver, `//tbody/tr[2]/td[2]/a`, text, config.TIMEOUT, false);
311297
res = await driver.executeScript("return nonKeyedDetector_result()");
@@ -365,4 +351,4 @@ async function main() {
365351
}
366352
}
367353

368-
main();
354+
main();

0 commit comments

Comments
 (0)