Raises an assertion error if the page has severe console errors

    @param driver: ShapewaysDriver
    @return: None
547168
def _log_fail_callback(driver, *args, **kwargs):
    

    try:
        logs = driver.get_browser_log(levels=[BROWSER_LOG_LEVEL_SEVERE])
        failure_message = 'There were severe console errors on this page: {}'.format(logs)
        failure_message = failure_message.replace('{', '{{').replace('}', '}}')  # Escape braces for error message
        driver.assertion.assert_false(
            logs,
            failure_message=failure_message
        )
    except (urllib2.URLError, socket.error, WebDriverException):
        # The session has ended, don't check the logs
        pass
335429
def fail(self, key, **kwargs):
        
        try:
            msg = self.error_messages[key]
        except KeyError:
            class_name = self.__class__.__name__
            msg = MISSING_ERROR_MESSAGE.format(class_name=class_name, key=key)
            raise AssertionError(msg)
        message_string = msg.format(**kwargs)
        raise ValidationError(message_string)
128184
function fail(message, id) {
    if (message === void 0) { message = ''; }
    if (id === void 0) { id = ''; }
    if (this.enabled) {
        throw new AssertionException(assertionTypes.FAIL, message, id);
    }
}
646983
public static <T> T assertExpectedCondition(ExpectedCondition<T> condition, WebDriver driver) {
		try {
			return waitUntil(condition, driver);
		} catch(TimeoutException e) {
			throw new AssertionError("Explicit wait timed out. The condition '" + condition + "' was not met" , e);
		}
	}
888144
function checkForAssertionErrors(args) {
  const isAssertion =
    args &&
    args.length > 0 &&
    typeof args[0] === 'object' &&
    args[0] !== null &&
    args[0].name === 'AssertionError';

  if (isAssertion) {
    args = Array.prototype.slice.call(args);
    args.unshift(`assert(${args[0].message})`);
  }
  return args;
}
313197
@Override
    public void expect() {
        try {
            webResult.setWebDriver(getWebDriver());
            webResult.expect();
            fail("Result should fail but it did not.");
        } catch (Exception e) {
            logger.debug("Negated failure:", e);
        } catch (AssertionError e) {
            logger.debug("Negated failure:", e);
        }
    }
1329082
function assertEqualsDelta(msg, expected, actual, epsilon) {
	var args = this.argsWithOptionalMsg_(arguments, 4);
	jstestdriver.assertCount++;
	msg = args[0];
	expected = args[1];
	actual = args[2];
	epsilon = args[3];

	if (!compareDelta_(expected, actual, epsilon)) {
		this.fail(msg + 'expected ' + epsilon + ' within ' +
							this.prettyPrintEntity_(expected) +
							' but was ' + this.prettyPrintEntity_(actual) + '');
	}
	return true;
}
1174178
def _check_status_errors(proto, content, error_traps=None):
        
        if content.status == proto.OK:
            return

        try:
            if content.status == proto.INTERNAL_ERROR:
                raise errors.UnknownValidatorError()
        except AttributeError:
            # Not every protobuf has every status enum, so pass AttributeErrors
            pass

        try:
            if content.status == proto.NOT_READY:
                raise errors.ValidatorNotReady()
        except AttributeError:
            pass

        try:
            if content.status == proto.NO_ROOT:
                raise errors.HeadNotFound()
        except AttributeError:
            pass

        try:
            if content.status == proto.INVALID_PAGING:
                raise errors.PagingInvalid()
        except AttributeError:
            pass

        try:
            if content.status == proto.INVALID_SORT:
                raise errors.SortInvalid()
        except AttributeError:
            pass

        # Check custom error traps from the particular route message
        if error_traps is not None:
            for trap in error_traps:
                trap.check(content.status)
1071067
def assert_exists(tag, element_id)
			if RWebSpec.framework == "Watir"
      	perform_assertion { assert(eval("#{tag}(:id, '#{element_id.to_s}').exists?"), "Element '#{tag}' with id: '#{element_id}' not found") }		
			else
				perform_assertion { assert( @web_browser.driver.find_element(:tag_name => tag, :id => element_id))}
			end
		
    end
731945
def add_assert_screenshot_methods(context_or_world, scenario):
    
    file_suffix = scenario.name

    def assert_screenshot(element_or_selector, filename, threshold=0, exclude_elements=[], driver_wrapper=None,
                          force=False):
        VisualTest(driver_wrapper, force).assert_screenshot(element_or_selector, filename, file_suffix, threshold,
                                                            exclude_elements)

    def assert_full_screenshot(filename, threshold=0, exclude_elements=[], driver_wrapper=None, force=False):
        VisualTest(driver_wrapper, force).assert_screenshot(None, filename, file_suffix, threshold, exclude_elements)

    # Monkey patching assert_screenshot method in PageElement to use the correct test name
    def assert_screenshot_page_element(self, filename, threshold=0, exclude_elements=[], force=False):
        VisualTest(self.driver_wrapper, force).assert_screenshot(self.web_element, filename, file_suffix, threshold,
                                                                 exclude_elements)

    context_or_world.assert_screenshot = assert_screenshot
    context_or_world.assert_full_screenshot = assert_full_screenshot
    PageElement.assert_screenshot = assert_screenshot_page_element
980597
function AssertionError( message , from , options = {} ) {
	this.message = message ;

	from = from || AssertionError ;

	// This will make Mocha and Tea-Time show the diff:
	this.actual = options.actual ;
	this.expected = options.expected ;
	this.expectationType = options.expectationType ;
	this.showDiff = !! options.showDiff ;

	if ( Error.captureStackTrace ) { Error.captureStackTrace( this , from ) ; }
	else { Object.defineProperty( this , 'stack' , { value: Error().stack , enumerable: true , configurable: true } ) ; }
}
97174
def assert_no_union(self, collection1, collection2,
                        failure_message='Expected no overlap between collections: "{}" and "{}"'):
        
        assertion = lambda: len(set(collection1).intersection(set(collection2))) == 0
        failure_message = unicode(failure_message).format(collection1, collection2)
        self.webdriver_assert(assertion, failure_message)
1253434
def raise_failure_exception(self, expect_or_allow='Allowed'):
        

        raise MockExpectationError(
            "{} '{}' to be called {}on {!r} with {}, but was not. ({}:{})".format(
                expect_or_allow,
                self._method_name,
                self._call_counter.error_string(),
                self._target.obj,
                self._expected_argument_string(),
                self._caller.filename,
                self._caller.lineno,
            )
        )
276836
function AssertionError(actual, expected, phrase, base) {
  this.name = 'AssertionError';
  this.actual = actual;
  this.expected = expected;
  this.message = 'expected ' + objectDisplay(actual) + ' ' +
      phrase + ' ' +
    objectDisplay(expected);

  if (typeof actual === 'object' || typeof expected === 'object') {
    this.showDiff = true;
  }

  Error.captureStackTrace(this, base);
}
1114118
def assert_visible(tag, element_id)
			if RWebSpec.framework =~ /selenium/i
      	perform_assertion { assert(eval("#{tag}(:id, '#{element_id.to_s}').displayed?"), "Element '#{tag}' with id: '#{element_id}' not visible") }
			else
			  perform_assertion { assert(eval("#{tag}(:id, '#{element_id.to_s}').visible?"), "Element '#{tag}' with id: '#{element_id}' not visible") }
			end
    end
1186570
def assert(assertion, desc = nil)
      if assertion
        pass
      else
        what = if block_given?
          yield
        else
          "Failed assert: assertion was "\
          "`#{Assert::U.show(assertion, __assert_config__)}`."
        end
        fail(fail_message(desc, what))
      end
    end
684823
def validate_driver_or_none(option, value):
    """"""
    if value is None:
        return value
    if not isinstance(value, DriverInfo):
        raise TypeError("%s must be an instance of DriverInfo" % (option,))
    return value