зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1387644 - Return NoSuchElementError when element is not found r=ato
MozReview-Commit-ID: LDHiyce09GR --HG-- extra : rebase_source : dff3b50237a3d124c0c41458c0adaf94694f45ef
This commit is contained in:
Родитель
3c82b65dc7
Коммит
74b035b657
|
@ -161,7 +161,7 @@ element.Store = class {
|
|||
* @returns {nsIDOMElement}
|
||||
* Element associated with reference.
|
||||
*
|
||||
* @throws {JavaScriptError}
|
||||
* @throws {NoSuchElementError}
|
||||
* If the provided reference is unknown.
|
||||
* @throws {StaleElementReferenceError}
|
||||
* If element has gone stale, indicating it is no longer attached to
|
||||
|
@ -170,7 +170,8 @@ element.Store = class {
|
|||
get(uuid, container) {
|
||||
let el = this.els[uuid];
|
||||
if (!el) {
|
||||
throw new JavaScriptError(`Element reference not seen before: ${uuid}`);
|
||||
throw new NoSuchElementError(`Element reference not seen before: ` +
|
||||
`${uuid}`);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -9,7 +9,7 @@ import struct
|
|||
import urllib
|
||||
|
||||
from marionette_driver import By
|
||||
from marionette_driver.errors import JavascriptException, NoSuchWindowException
|
||||
from marionette_driver.errors import NoSuchElementException, NoSuchWindowException
|
||||
from marionette_harness import (
|
||||
MarionetteTestCase,
|
||||
skip,
|
||||
|
@ -275,12 +275,12 @@ class TestScreenCaptureChrome(WindowManagerMixin, ScreenCaptureTestCase):
|
|||
self.marionette.navigate(box)
|
||||
content_element = self.marionette.find_element(By.ID, "green")
|
||||
|
||||
self.assertRaisesRegexp(JavascriptException, "Element reference not seen before",
|
||||
self.assertRaisesRegexp(NoSuchElementException, "Element reference not seen before",
|
||||
self.marionette.screenshot, highlights=[content_element])
|
||||
|
||||
chrome_document_element = self.document_element
|
||||
with self.marionette.using_context('content'):
|
||||
self.assertRaisesRegexp(JavascriptException, "Element reference not seen before",
|
||||
self.assertRaisesRegexp(NoSuchElementException, "Element reference not seen before",
|
||||
self.marionette.screenshot,
|
||||
highlights=[chrome_document_element])
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче