package tags
Type Members
-
trait
CPU
extends Annotation
Annotation used to tag a test, or suite of tests, as being CPU-intensive (i.e., consuming a lot of CPU time when it runs).
Annotation used to tag a test, or suite of tests, as being CPU-intensive (i.e., consuming a lot of CPU time when it runs).
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
If you wish to mark an entire suite of tests as being CPU-intensive, you can annotate the test class with
@CPU, like this:package org.scalatest.examples.flatspec.cpuall import org.scalatest._ import tags.CPU @CPU class SetSpec extends FlatSpec { "An empty Set" should "have size 0" in { assert(Set.empty.size === 0) } it should "produce NoSuchElementException when head is invoked" in { intercept[NoSuchElementException] { Set.empty.head } } }When you mark a test class with a tag annotation, ScalaTest will mark each test defined in that class with that tag. Thus, marking the
SetSpecin the above example with the@CPUtag annotation means that both tests in the class are CPU-intensive.Another use case for
@CPUis to mark test methods as CPU-intensive in traitsSpecandfixture.Spec. Here's an example:package org.scalatest.examples.spec.cpu import org.scalatest._ import tags.CPU class SetSpec extends Spec { @CPU def `an empty Set should have size 0` { assert(Set.empty.size === 0) } def `invoking head on an empty Set should produce NoSuchElementException` { intercept[NoSuchElementException] { Set.empty.head } } }The main use case of annotating a test or suite of tests is to select or deselect them during runs by supplying tags to include and/or exclude. For more information, see the relevant section in the documentation of object
Runner. -
trait
ChromeBrowser
extends Annotation
Tag that indicates a Selenium test uses the Chrome browser.
Tag that indicates a Selenium test uses the Chrome browser.
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
-
trait
Disk
extends Annotation
Annotation used to tag a test, or suite of tests, as being disk-intensive (i.e., consuming a large amount of disk-IO bandwidth when it runs).
Annotation used to tag a test, or suite of tests, as being disk-intensive (i.e., consuming a large amount of disk-IO bandwidth when it runs).
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
If you wish to mark an entire suite of tests as being disk-intensive, you can annotate the test class with
@Disk, like this:package org.scalatest.examples.flatspec.diskall import org.scalatest._ import tags.Disk @Disk class SetSpec extends FlatSpec { "An empty Set" should "have size 0" in { assert(Set.empty.size === 0) } it should "produce NoSuchElementException when head is invoked" in { intercept[NoSuchElementException] { Set.empty.head } } }When you mark a test class with a tag annotation, ScalaTest will mark each test defined in that class with that tag. Thus, marking the
SetSpecin the above example with the@Disktag annotation means that both tests in the class are disk-intensive.Another use case for
@Diskis to mark test methods as disk-intensive in traitsSpecandfixture.Spec. Here's an example:package org.scalatest.examples.spec.disk import org.scalatest._ import tags.Disk class SetSpec extends Spec { @Disk def `an empty Set should have size 0` { assert(Set.empty.size === 0) } def `invoking head on an empty Set should produce NoSuchElementException` { intercept[NoSuchElementException] { Set.empty.head } } }The main use case of annotating a test or suite of tests is to select or deselect them during runs by supplying tags to include and/or exclude. For more information, see the relevant section in the documentation of object
Runner. -
trait
FirefoxBrowser
extends Annotation
Tag that indicates a Selenium test uses the Firefox browser.
Tag that indicates a Selenium test uses the Firefox browser.
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
-
trait
HtmlUnitBrowser
extends Annotation
Tag that indicates a Selenium test uses the HtmlUnit browser.
Tag that indicates a Selenium test uses the HtmlUnit browser.
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
-
trait
InternetExplorerBrowser
extends Annotation
Tag that indicates a Selenium test uses the InternetExplorer browser.
Tag that indicates a Selenium test uses the InternetExplorer browser.
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
-
trait
Network
extends Annotation
Annotation used to tag a test, or suite of tests, as being network-intensive (i.e., consuming a large amount of network bandwidth when it runs).
Annotation used to tag a test, or suite of tests, as being network-intensive (i.e., consuming a large amount of network bandwidth when it runs).
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
If you wish to mark an entire suite of tests as being network-intensive, you can annotate the test class with
@Network, like this:package org.scalatest.examples.flatspec.networkall import org.scalatest._ import tags.Network @Network class SetSpec extends FlatSpec { "An empty Set" should "have size 0" in { assert(Set.empty.size === 0) } it should "produce NoSuchElementException when head is invoked" in { intercept[NoSuchElementException] { Set.empty.head } } }When you mark a test class with a tag annotation, ScalaTest will mark each test defined in that class with that tag. Thus, marking the
SetSpecin the above example with the@Networktag annotation means that both tests in the class are network-intensive.Another use case for
@Networkis to mark test methods as network-intensive in traitsSpecandfixture.Spec. Here's an example:package org.scalatest.examples.spec.network import org.scalatest._ import tags.Network class SetSpec extends Spec { @Network def `an empty Set should have size 0` { assert(Set.empty.size === 0) } def `invoking head on an empty Set should produce NoSuchElementException` { intercept[NoSuchElementException] { Set.empty.head } } }The main use case of annotating a test or suite of tests is to select or deselect them during runs by supplying tags to include and/or exclude. For more information, see the relevant section in the documentation of object
Runner. -
trait
Retryable
extends Annotation
Tag annotation that indicates a test is a candidate for retrying on either failure, cancellation, or both.
Tag annotation that indicates a test is a candidate for retrying on either failure, cancellation, or both.
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
This tag annotation is intended to be used in conjunction with trait
Retries, to identify tests that are candidates for retrying.If you wish to mark all tests in a test class as being candidates for retries, you can annotate the test class with
@Retryable, like this:package org.scalatest.examples.flatspec.retryableall import org.scalatest._ import tags.Retryable @Retryable class SetSpec extends FlatSpec with Retries { override def withFixture(test: NoArgTest) = { if (isRetryable(test)) withRetry { super.withFixture(test) } else super.withFixture(test) } "An empty Set" should "have size 0" in { assert(Set.empty.size === 0) } it should "produce NoSuchElementException when head is invoked" in { intercept[NoSuchElementException] { Set.empty.head } } }When you mark a test class with a tag annotation, ScalaTest will mark each test defined in that class with that tag. Thus, marking the
SetSpecin the above example with the@Retryabletag annotation means that both tests in the class are candidates for retrying.Another use case for
@Retryableis to mark test methods as being candidates for retries in traitsSpecandfixture.Spec. Here's an example:package org.scalatest.examples.spec.disk import org.scalatest._ import tags.Disk class SetSpec extends Spec with Retries { override def withFixture(test: NoArgTest) = { if (isRetryable(test)) withRetry { super.withFixture(test) } else super.withFixture(test) } @Retryable def `an empty Set should have size 0` { assert(Set.empty.size === 0) } def `invoking head on an empty Set should produce NoSuchElementException` { intercept[NoSuchElementException] { Set.empty.head } } }The main use case of annotating a test or suite of tests is to select or deselect them during runs by supplying tags to include and/or exclude. For more information, see the relevant section in the documentation of object
Runner. -
trait
SafariBrowser
extends Annotation
Tag that indicates a Selenium test uses the Safari browser.
Tag that indicates a Selenium test uses the Safari browser.
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
-
trait
Slow
extends Annotation
Annotation used to tag a test, or suite of tests, as being slow (i.e., requiring a long time to run).
Annotation used to tag a test, or suite of tests, as being slow (i.e., requiring a long time to run).
Note: This is actually an annotation defined in Java, not a Scala trait. It must be defined in Java instead of Scala so it will be accessible at runtime. It has been inserted into Scaladoc by pretending it is a trait.
If you wish to mark an entire suite of tests as being slow, you can annotate the test class with
@Slow, like this:package org.scalatest.examples.flatspec.slowall import org.scalatest._ import tags.Slow @Slow class SetSpec extends FlatSpec { "An empty Set" should "have size 0" in { assert(Set.empty.size === 0) } it should "produce NoSuchElementException when head is invoked" in { intercept[NoSuchElementException] { Set.empty.head } } }When you mark a test class with a tag annotation, ScalaTest will mark each test defined in that class with that tag. Thus, marking the
SetSpecin the above example with the@Slowtag annotation means that both tests in are slow.Another use case for
@Slowis to mark test methods as slow in traitsSpecandfixture.Spec. Here's an example:package org.scalatest.examples.spec.slow import org.scalatest._ import tags.Slow class SetSpec extends Spec { @Slow def `an empty Set should have size 0` { assert(Set.empty.size === 0) } def `invoking head on an empty Set should produce NoSuchElementException` { intercept[NoSuchElementException] { Set.empty.head } } }The main use case of annotating a test or suite of tests is to select or deselect them during runs by supplying tags to include and/or exclude. For more information, see the relevant section in the documentation of object
Runner.