* 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)
| 152 | * @return {!Condition<boolean>} The new condition. |
| 153 | */ |
| 154 | function titleContains(substr) { |
| 155 | return new Condition('for title to contain ' + JSON.stringify(substr), function (driver) { |
| 156 | return driver.getTitle().then(function (title) { |
| 157 | return title.indexOf(substr) !== -1 |
| 158 | }) |
| 159 | }) |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Creates a condition that will wait for the current page's title to match the |