Implementation:SeleniumHQ Selenium Closure Testing TestCase
| Knowledge Sources | |
|---|---|
| Domains | JavaScript_Atoms, Vendored_Library |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
Vendored Google Closure Library module providing a test case class for organizing and running sets of test functions, used by Selenium JavaScript atoms.
Description
goog.testing.TestCase is a vendored copy of the Google Closure Library module. It represents a JsUnit-style test case composed of multiple test functions with lifecycle hooks: setUpPage, tearDownPage, setUp, tearDown, and shouldRunTests. It supports auto-discovery of test functions by prefix, promise-based asynchronous testing, configurable test ordering, and detailed result reporting. It integrates with goog.testing.asserts for assertions and goog.testing.CspViolationObserver for CSP monitoring. Selenium uses this as part of its JavaScript atom infrastructure.
Usage
This module is consumed internally by Selenium's JavaScript atoms build system. Not imported directly by end users.
Code Reference
Source Location
- Repository: SeleniumHQ_Selenium
- File: third_party/closure/goog/testing/testcase.js
- Lines: 1-2527
Key Exports
goog.provide('goog.testing.TestCase');
goog.provide('goog.testing.TestCase.Error');
goog.provide('goog.testing.TestCase.Order');
goog.provide('goog.testing.TestCase.Result');
goog.provide('goog.testing.TestCase.Test');
// Lifecycle hooks: setUpPage, tearDownPage, setUp, tearDown
// Auto-discovers test functions prefixed with "test"
// Supports promise-based async tests