* Creates a condition that will wait for the current page's title to contain * the given substring. * * @param {string} substr The substring that should be present in the page * title. * @return {!Condition } The new condition.
(substr)
| 150 | * @return {!Condition<boolean>} The new condition. |
| 151 | */ |
| 152 | function titleContains(substr) { |
| 153 | return new Condition('for title to contain ' + JSON.stringify(substr), function (driver) { |
| 154 | return driver.getTitle().then(function (title) { |
| 155 | return title.indexOf(substr) !== -1 |
| 156 | }) |
| 157 | }) |
| 158 | } |
| 159 | |
| 160 | /** |
| 161 | * Creates a condition that will wait for the current page's title to match the |