Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: test/wrappers/pages.js

Issue 29891677: Noissue - Make subscribe link tests more reliable by waiting for options page to be ready (Closed)
Left Patch Set: Created Sept. 25, 2018, 7:46 p.m.
Right Patch Set: Increased timeout for options page tab as requested by Ross Created Sept. 26, 2018, 11:06 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 () => driver.switchTo().window(returnTo) 47 () => driver.switchTo().window(returnTo)
48 ); 48 );
49 } 49 }
50 50
51 function testSubscribeLink(driver) 51 function testSubscribeLink(driver)
52 { 52 {
53 return driver.findElement(By.id("subscribe-button")).click().then(() => 53 return driver.findElement(By.id("subscribe-button")).click().then(() =>
54 driver.wait(() => 54 driver.wait(() =>
55 driver.getAllWindowHandles().then(handles => 55 driver.getAllWindowHandles().then(handles =>
56 handles.length > 2 ? handles : null 56 handles.length > 2 ? handles : null
57 ), 1000 57 ), 3000
58 ) 58 )
59 ).then(handles => 59 ).then(handles =>
60 closeWindow(driver, handles[2], handles[1], () => 60 closeWindow(driver, handles[2], handles[1], () =>
61 driver.wait(until.ableToSwitchToFrame(0), 1000).then(() => 61 driver.wait(until.ableToSwitchToFrame(0), 1000).then(() =>
tlucas 2018/09/26 08:28:17 In order to not reject subscriptions, which might
Sebastian Noack 2018/09/26 11:07:36 But if there is a bug (caught by this test) with t
tlucas 2018/09/26 18:19:40 Acknowledged.
62 driver.wait(until.elementLocated(By.id("dialog-content-predefined")), 62 driver.wait(until.elementLocated(By.id("dialog-content-predefined")),
63 1000) 63 1000)
64 ).then(dialog => 64 ).then(dialog =>
65 Promise.all([ 65 Promise.all([
66 dialog.isDisplayed(), 66 dialog.isDisplayed(),
67 dialog.findElement(By.css("h3")).getText() 67 dialog.findElement(By.css("h3")).getText()
68 ]).then(([displayed, title]) => 68 ]).then(([displayed, title]) =>
69 { 69 {
70 assert.ok(displayed, "subscribe link: dialog shown"); 70 assert.ok(displayed, "subscribe link: dialog shown");
71 assert.equal(title, "ABP Testcase Subscription", 71 assert.equal(title, "ABP Testcase Subscription",
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 title 245 title
246 ) 246 )
247 ); 247 );
248 }); 248 });
249 } 249 }
250 return p2; 250 return p2;
251 }); 251 });
252 return p1; 252 return p1;
253 }); 253 });
254 }); 254 });
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld