Skip to content

Commit

Permalink
Merge branch 'master' into crac-service-helm-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski authored May 10, 2023
2 parents 856633a + d0528a5 commit 2c21c71
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ch.renku.acceptancetests.workflows._

class AnonymouSessionSpec extends AcceptanceSpec with Project with AnonEnv with Login {

Scenario("User can launch session") {
scenario("User can launch session") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ import scala.util.matching.Regex
*/
class BatchProjectRemovalSpec extends AcceptanceSpec with Login with RemoveProject {

Scenario("User can delete many projects project") {
scenario("User can delete many projects project") {

batchRemoveConfig match {
case Some(config) =>
if (config.batchRemove) `login and remove projects`(config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import ch.renku.acceptancetests.workflows._
class DatasetModificationSpec extends AcceptanceSpec with Login with Project with Datasets with KnowledgeGraphApi {
import Modification._

Scenario("From the UI the user can modify a dataset and only interact with its latest version") {
scenario("From the UI the user can modify a dataset and only interact with its latest version") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import ch.renku.acceptancetests.workflows._

class DatasetUploadSpec extends AcceptanceSpec with Login with Project with Datasets with KnowledgeGraphApi {

Scenario("From the UI the user can create a dataset with an uploaded file") {
scenario("From the UI the user can create a dataset with an uploaded file") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FreeTextDatasetSearchSpec
with DatasetsSearch
with KnowledgeGraphApi {

Scenario("User can search for datasets") {
scenario("User can search for datasets") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class HandsOnSpec
with Datasets
with KnowledgeGraphApi {

Scenario("User can do hands-on tutorial") {
scenario("User can do hands-on tutorial") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ch.renku.acceptancetests.workflows._

class JupyterNotebookForPrivateProjectSpec extends AcceptanceSpec with Login with PrivateProject with JupyterNotebook {

Scenario("User can launch Jupyter notebook when the project is private") {
scenario("User can launch Jupyter notebook when the project is private") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class LineageSpec
with CLIConfiguration
with KnowledgeGraphApi {

Scenario("User can see lineage") {
scenario("User can see lineage") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class LoginSpec extends AcceptanceSpec with Login {

Feature("User logging in and out") {

Scenario("Logging into Renku") {
scenario("Logging into Renku") {
`log in to Renku`
`log out of Renku`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import scala.concurrent.duration._

class ProjectForkingSpec extends AcceptanceSpec with Login with Project {

Scenario("User can fork a project") {
scenario("User can fork a project") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ch.renku.acceptancetests.workflows._

class ProjectSettingsModificationSpec extends AcceptanceSpec with Login with Project with Settings {

Scenario("User can set project tags and description") {
scenario("User can set project tags and description") {

`log in to Renku`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import ch.renku.acceptancetests.workflows._

class UnprivilegedSessionSpec extends AcceptanceSpec with AnonEnv with Login {

Scenario("User can launch unprivileged session") {
scenario("User can launch unprivileged session") {
`log in to Renku`
`launch unprivileged session` foreach (`stop session`(_))
`log out of Renku`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import ch.renku.acceptancetests.workflows.Environments
import org.openqa.selenium.WebDriver
import org.openqa.selenium.chrome.{ChromeDriver, ChromeDriverService, ChromeOptions}
import org.scalatest._
import org.scalatest.featurespec.AnyFeatureSpec
import org.scalatest.featurespec.FixtureAnyFeatureSpec
import org.scalatest.matchers.should
import org.scalatestplus.selenium.WebBrowser

trait AcceptanceSpec
extends AnyFeatureSpec
extends FixtureAnyFeatureSpec
with BddWording
with BeforeAndAfterAll
with should.Matchers
Expand Down Expand Up @@ -67,4 +67,9 @@ trait AcceptanceSpec
new ChromeOptions().addArguments("window-size=1920,1600")
)
}

protected override type FixtureParam = Unit

override def withFixture(test: OneArgTest): Outcome =
withFixture(test.toNoArgTest((): FixtureParam))
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,22 @@

package ch.renku.acceptancetests.tooling

import org.scalactic.source
import org.scalatest.Tag
import org.scalatest.featurespec.AnyFeatureSpecLike
import org.scalatest.featurespec.FixtureAnyFeatureSpecLike

trait BddWording extends AnyFeatureSpecLike {
trait BddWording extends FixtureAnyFeatureSpecLike {
self: AcceptanceSpec =>

import TestLogger.logger

override def Scenario(test: String, testTags: Tag*)(testFun: => Any)(implicit pos: source.Position): Unit = {
override def Scenario(test: String, testTags: Tag*): ResultOfScenarioInvocation = {
logger.info(test)
super.Scenario(s"$test - ☑ success", testTags: _*)(testFun)
super.Scenario(s"$test - ☑ success", testTags: _*)
}

def scenario(test: String, testTags: Tag*)(testFun: => Any): Unit =
Scenario(test, testTags: _*)(_ => testFun)

def Given(string: String): Unit = logger.info(s"Given $string")
def When(string: String): Unit = logger.info(s"When $string")
def Then(string: String): Unit = logger.info(s"Then $string")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,10 @@ import ch.renku.acceptancetests.model.projects.{ProjectDetails, Template, Visibi
import ch.renku.acceptancetests.pages._
import ch.renku.acceptancetests.tooling.AcceptanceSpec
import org.openqa.selenium.interactions.Actions
import org.openqa.selenium.StaleElementReferenceException;
import org.scalatest.BeforeAndAfterAll
import org.scalatest.Outcome

import java.lang.System.getProperty
import scala.concurrent.duration._
import scala.util.Try

trait ExtantProject {
def maybeExtantProject(projectVisibility: Visibility): Option[ProjectDetails] =
Expand All @@ -43,15 +41,15 @@ trait ExtantProject {
}
}

trait PrivateProject extends Project with BeforeAndAfterAll with ExtantProject {
trait PrivateProject extends Project with ExtantProject {
self: AcceptanceSpec =>

protected override lazy val projectVisibility: Visibility = Visibility.Private
protected implicit override lazy val projectDetails: ProjectDetails =
maybeExtantProject(projectVisibility).getOrElse(ProjectDetails.generate().copy(visibility = projectVisibility))
}

trait Project extends RemoveProject with BeforeAndAfterAll with ExtantProject {
trait Project extends RemoveProject with ExtantProject {
self: AcceptanceSpec =>

protected lazy val projectVisibility: Visibility = Visibility.Public
Expand Down Expand Up @@ -185,12 +183,16 @@ trait Project extends RemoveProject with BeforeAndAfterAll with ExtantProject {
NewProjectPage.createButton.click() sleep (10 seconds)
}

protected override def afterAll(): Unit = {
maybeExtantProject(projectVisibility) match {
case Some(_) => ()
case _ => `remove project in GitLab`(projectDetails.asProjectIdentifier)
protected override type FixtureParam = Unit

override def withFixture(test: OneArgTest): Outcome = {

val outcome = withFixture(test.toNoArgTest((): FixtureParam))

if (outcome.isSucceeded && maybeExtantProject(projectVisibility).isEmpty) {
`remove project in GitLab`(projectDetails.asProjectIdentifier)
}

super.afterAll()
outcome
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ trait RemoveProject extends BrowserNavigation {
self: AcceptanceSpec with GitLabApi =>

def `remove project in GitLab`(implicit projectId: ProjectIdentifier): Unit = {
When(s"the '${projectId.slug}' project is removed")
And(s"the '${projectId.slug}' project is removed")
`delete project in GitLab`(projectId)
sleep(1 second)
}
Expand Down

0 comments on commit 2c21c71

Please sign in to comment.