Package

org.scalatest

tags

Permalink

package tags

Visibility
  1. Public
  2. All

Type Members

  1. trait CPU extends Annotation

    Permalink

    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 SetSpec in the above example with the @CPU tag annotation means that both tests in the class are CPU-intensive.

    Another use case for @CPU is to mark test methods as CPU-intensive in traits Spec and fixture.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.

  2. trait ChromeBrowser extends Annotation

    Permalink

    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.

  3. trait Disk extends Annotation

    Permalink

    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 SetSpec in the above example with the @Disk tag annotation means that both tests in the class are disk-intensive.

    Another use case for @Disk is to mark test methods as disk-intensive in traits Spec and fixture.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.

  4. trait FirefoxBrowser extends Annotation

    Permalink

    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.

  5. trait HtmlUnitBrowser extends Annotation

    Permalink

    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.

  6. trait InternetExplorerBrowser extends Annotation

    Permalink

    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.

  7. trait Network extends Annotation

    Permalink

    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 SetSpec in the above example with the @Network tag annotation means that both tests in the class are network-intensive.

    Another use case for @Network is to mark test methods as network-intensive in traits Spec and fixture.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.

  8. trait Retryable extends Annotation

    Permalink

    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 SetSpec in the above example with the @Retryable tag annotation means that both tests in the class are candidates for retrying.

    Another use case for @Retryable is to mark test methods as being candidates for retries in traits Spec and fixture.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.

  9. trait SafariBrowser extends Annotation

    Permalink

    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.

  10. trait Slow extends Annotation

    Permalink

    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 SetSpec in the above example with the @Slow tag annotation means that both tests in are slow.

    Another use case for @Slow is to mark test methods as slow in traits Spec and fixture.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.

Ungrouped