1
1
import java .util .UUID
2
2
3
- import org .broadinstitute .dsde .firecloud .Config
4
- import org .broadinstitute .dsde .firecloud .api .Orchestration
5
3
import org .broadinstitute .dsde .firecloud .data .TestData
6
- import org .broadinstitute .dsde .firecloud .pages .{WebBrowserSpec , WorkspaceListPage , WorkspaceMethodConfigPage , WorkspaceSummaryPage }
4
+ import org .broadinstitute .dsde .firecloud .pages .{WebBrowserSpec , WorkspaceListPage , WorkspaceMethodConfigPage }
5
+ import org .broadinstitute .dsde .firecloud .{CleanUp , Config }
7
6
import org .scalatest ._
8
7
9
- class MethodConfigTabSpec extends FreeSpec with WebBrowserSpec with BeforeAndAfterAll with BeforeAndAfterEach {
8
+ class MethodConfigTabSpec extends FreeSpec with WebBrowserSpec with CleanUp {
10
9
11
- val wsNamespace = " broad-dsde-dev"
10
+ val billingProject = " broad-dsde-dev"
12
11
val methodConfigName = " test_method" + UUID .randomUUID().toString
13
12
val wrongRootEntityErrorText = " Error: Method configuration expects an entity of type sample, but you gave us an entity of type participant."
14
13
val noExpressionErrorText = " Error: Method configuration expects an entity of type sample, but you gave us an entity of type sample_set."
@@ -17,57 +16,52 @@ class MethodConfigTabSpec extends FreeSpec with WebBrowserSpec with BeforeAndAft
17
16
" launch a simple workflow" in withWebDriver { implicit driver =>
18
17
val wsName = " TestSpec_FireCloud_launch_a_simple_workflow" + UUID .randomUUID.toString
19
18
implicit val authToken = Config .AuthTokens .testFireC
20
- Orchestration .workspaces.create(wsNamespace, wsName)
21
- Orchestration .importMetaData(wsNamespace, wsName, " entities" , TestData .SingleParticipant .participantEntity)
19
+ api.workspaces.create(billingProject, wsName)
20
+ register cleanUp api.workspaces.delete(billingProject, wsName)
21
+ api.importMetaData(billingProject, wsName, " entities" , TestData .SingleParticipant .participantEntity)
22
22
23
23
signIn(Config .Accounts .testUserEmail, Config .Accounts .testUserPassword)
24
- val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (wsNamespace, wsName)
25
- workspaceMethodConfigPage.open
24
+ val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (billingProject, wsName).open
26
25
val methodConfigDetailsPage = workspaceMethodConfigPage.importMethodConfig(TestData .SimpleMethodConfig .namespace,
27
26
TestData .SimpleMethodConfig .name, TestData .SimpleMethodConfig .snapshotId, methodConfigName, TestData .SimpleMethodConfig .rootEntityType)
28
27
methodConfigDetailsPage.editMethodConfig(inputs = Some (TestData .SimpleMethodConfig .inputs))
29
28
val submissionDetailsPage = methodConfigDetailsPage.launchAnalysis(TestData .SimpleMethodConfig .rootEntityType, TestData .SingleParticipant .entityId)
30
29
31
30
submissionDetailsPage.waitUntilSubmissionCompletes() // This feels like the wrong way to do this?
32
31
assert(submissionDetailsPage.verifyWorkflowSucceeded())
33
- val submissionSummaryPage = new WorkspaceSummaryPage (wsNamespace, wsName)
34
- submissionSummaryPage.open
35
- submissionSummaryPage.deleteWorkspace()
36
32
}
37
33
38
34
" launch modal with no default entities" in withWebDriver { implicit driver =>
39
35
val wsName = " TestSpec_FireCloud_launch_modal_no_default_entities" + UUID .randomUUID.toString
40
36
implicit val authToken = Config .AuthTokens .testFireC
41
- Orchestration .workspaces.create(wsNamespace, wsName)
42
- Orchestration .importMetaData(wsNamespace, wsName, " entities" , TestData .SingleParticipant .participantEntity)
37
+ api.workspaces.create(billingProject, wsName)
38
+ register cleanUp api.workspaces.delete(billingProject, wsName)
39
+ api.importMetaData(billingProject, wsName, " entities" , TestData .SingleParticipant .participantEntity)
43
40
44
41
signIn(Config .Accounts .testUserEmail, Config .Accounts .testUserPassword)
45
- val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (wsNamespace , wsName)
42
+ val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (billingProject , wsName)
46
43
workspaceMethodConfigPage.open
47
44
val methodConfigDetailsPage = workspaceMethodConfigPage.importMethodConfig(TestData .SimpleMethodConfig .namespace,
48
45
TestData .SimpleMethodConfig .name, TestData .SimpleMethodConfig .snapshotId, methodConfigName, " participant_set" )
49
46
methodConfigDetailsPage.editMethodConfig(inputs = Some (TestData .SimpleMethodConfig .inputs))
50
47
val launchModal = methodConfigDetailsPage.openlaunchModal()
51
48
assert(launchModal.verifyNoDefaultEntityMessage())
52
49
launchModal.closeModal()
53
-
54
- val submissionSummaryPage = new WorkspaceSummaryPage (wsNamespace, wsName)
55
- submissionSummaryPage.open
56
- submissionSummaryPage.deleteWorkspace()
57
50
}
58
51
59
52
" launch modal with workflows warning" in withWebDriver { implicit driver =>
60
53
val wsName = " TestSpec_FireCloud_launch_modal_with_workflows_warning" + UUID .randomUUID.toString
61
54
implicit val authToken = Config .AuthTokens .testFireC
62
- Orchestration .workspaces.create(wsNamespace, wsName)
55
+ api.workspaces.create(billingProject, wsName)
56
+ register cleanUp api.workspaces.delete(billingProject, wsName)
63
57
64
- Orchestration .importMetaData(wsNamespace , wsName, " entities" , TestData .SingleParticipant .participantEntity)
65
- Orchestration .importMetaData(wsNamespace , wsName, " entities" , TestData .HundredAndOneSampleSet .samples)
66
- Orchestration .importMetaData(wsNamespace , wsName, " entities" , TestData .HundredAndOneSampleSet .sampleSetCreation)
67
- Orchestration .importMetaData(wsNamespace , wsName, " entities" , TestData .HundredAndOneSampleSet .sampleSetMembership)
58
+ api .importMetaData(billingProject , wsName, " entities" , TestData .SingleParticipant .participantEntity)
59
+ api .importMetaData(billingProject , wsName, " entities" , TestData .HundredAndOneSampleSet .samples)
60
+ api .importMetaData(billingProject , wsName, " entities" , TestData .HundredAndOneSampleSet .sampleSetCreation)
61
+ api .importMetaData(billingProject , wsName, " entities" , TestData .HundredAndOneSampleSet .sampleSetMembership)
68
62
69
63
signIn(Config .Accounts .testUserEmail, Config .Accounts .testUserPassword)
70
- val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (wsNamespace , wsName)
64
+ val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (billingProject , wsName)
71
65
workspaceMethodConfigPage.open
72
66
val methodConfigDetailsPage = workspaceMethodConfigPage.importMethodConfig(TestData .SimpleMethodConfig .namespace,
73
67
TestData .SimpleMethodConfig .name, TestData .SimpleMethodConfig .snapshotId, methodConfigName, " sample" )
@@ -78,21 +72,18 @@ class MethodConfigTabSpec extends FreeSpec with WebBrowserSpec with BeforeAndAft
78
72
launchModal.searchAndSelectEntity(TestData .HundredAndOneSampleSet .entityId)
79
73
assert(launchModal.verifyWorkflowsWarning())
80
74
launchModal.closeModal()
81
-
82
- val submissionSummaryPage = new WorkspaceSummaryPage (wsNamespace, wsName)
83
- submissionSummaryPage.open
84
- submissionSummaryPage.deleteWorkspace()
85
75
}
86
76
87
77
" launch workflow with wrong root entity" in withWebDriver { implicit driver =>
88
78
val wsName = " TestSpec_FireCloud_launch_workflow_with_wrong_root_entity" + UUID .randomUUID.toString
89
79
implicit val authToken = Config .AuthTokens .testFireC
90
- Orchestration .workspaces.create(wsNamespace, wsName)
91
- Orchestration .importMetaData(wsNamespace, wsName, " entities" , TestData .SingleParticipant .participantEntity)
80
+ api.workspaces.create(billingProject, wsName)
81
+ register cleanUp api.workspaces.delete(billingProject, wsName)
82
+ api.importMetaData(billingProject, wsName, " entities" , TestData .SingleParticipant .participantEntity)
92
83
93
84
signIn(Config .Accounts .testUserEmail, Config .Accounts .testUserPassword)
94
85
val workspaceListPage = new WorkspaceListPage
95
- val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (wsNamespace , wsName)
86
+ val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (billingProject , wsName)
96
87
workspaceMethodConfigPage.open
97
88
val methodConfigDetailsPage = workspaceMethodConfigPage.importMethodConfig(TestData .SimpleMethodConfig .namespace,
98
89
TestData .SimpleMethodConfig .name, TestData .SimpleMethodConfig .snapshotId, methodConfigName, " sample" )
@@ -104,25 +95,22 @@ class MethodConfigTabSpec extends FreeSpec with WebBrowserSpec with BeforeAndAft
104
95
launchModal.clickLaunchButton()
105
96
assert(launchModal.verifyWrongEntityError(wrongRootEntityErrorText))
106
97
launchModal.closeModal()
107
-
108
- val submissionSummaryPage = new WorkspaceSummaryPage (wsNamespace, wsName)
109
- submissionSummaryPage.open
110
- submissionSummaryPage.deleteWorkspace()
111
98
}
112
99
113
100
" launch workflow on set without expression" in withWebDriver { implicit driver =>
114
101
val wsName = " TestSpec_FireCloud_launch_workflow_on_set_without_expression" + UUID .randomUUID.toString
115
102
implicit val authToken = Config .AuthTokens .testFireC
116
- Orchestration .workspaces.create(wsNamespace, wsName)
117
103
118
- Orchestration .importMetaData(wsNamespace, wsName, " entities" , TestData .SingleParticipant .participantEntity)
119
- Orchestration .importMetaData(wsNamespace, wsName, " entities" , TestData .HundredAndOneSampleSet .samples)
120
- Orchestration .importMetaData(wsNamespace, wsName, " entities" , TestData .HundredAndOneSampleSet .sampleSetCreation)
121
- Orchestration .importMetaData(wsNamespace, wsName, " entities" , TestData .HundredAndOneSampleSet .sampleSetMembership)
104
+ api.workspaces.create(billingProject, wsName)
105
+ register cleanUp api.workspaces.delete(billingProject, wsName)
106
+
107
+ api.importMetaData(billingProject, wsName, " entities" , TestData .SingleParticipant .participantEntity)
108
+ api.importMetaData(billingProject, wsName, " entities" , TestData .HundredAndOneSampleSet .samples)
109
+ api.importMetaData(billingProject, wsName, " entities" , TestData .HundredAndOneSampleSet .sampleSetCreation)
110
+ api.importMetaData(billingProject, wsName, " entities" , TestData .HundredAndOneSampleSet .sampleSetMembership)
122
111
123
112
signIn(Config .Accounts .testUserEmail, Config .Accounts .testUserPassword)
124
- val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (wsNamespace, wsName)
125
- workspaceMethodConfigPage.open
113
+ val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (billingProject, wsName).open
126
114
val methodConfigDetailsPage = workspaceMethodConfigPage.importMethodConfig(TestData .SimpleMethodConfig .namespace,
127
115
TestData .SimpleMethodConfig .name, TestData .SimpleMethodConfig .snapshotId, methodConfigName, " sample" )
128
116
methodConfigDetailsPage.editMethodConfig(inputs = Some (TestData .SimpleMethodConfig .inputs))
@@ -133,30 +121,36 @@ class MethodConfigTabSpec extends FreeSpec with WebBrowserSpec with BeforeAndAft
133
121
launchModal.clickLaunchButton()
134
122
assert(launchModal.verifyWrongEntityError(noExpressionErrorText))
135
123
launchModal.closeModal()
136
-
137
- val submissionSummaryPage = new WorkspaceSummaryPage (wsNamespace, wsName)
138
- submissionSummaryPage.open
139
- submissionSummaryPage.deleteWorkspace()
140
-
141
124
}
142
125
143
126
" launch workflow with input not defined" in withWebDriver { implicit driver =>
144
127
val wsName = " TestSpec_FireCloud_launch_workflow_input_not_defined" + UUID .randomUUID.toString
145
128
implicit val authToken = Config .AuthTokens .testFireC
146
- Orchestration .workspaces.create(wsNamespace, wsName)
147
- Orchestration .importMetaData(wsNamespace, wsName, " entities" , TestData .SingleParticipant .participantEntity)
129
+ api.workspaces.create(billingProject, wsName)
130
+ register cleanUp api.workspaces.delete(billingProject, wsName)
131
+ api.importMetaData(billingProject, wsName, " entities" , TestData .SingleParticipant .participantEntity)
148
132
149
133
signIn(Config .Accounts .testUserEmail, Config .Accounts .testUserPassword)
150
- val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (wsNamespace , wsName)
134
+ val workspaceMethodConfigPage = new WorkspaceMethodConfigPage (billingProject , wsName)
151
135
workspaceMethodConfigPage.open
152
136
val methodConfigDetailsPage = workspaceMethodConfigPage.importMethodConfig(TestData .SimpleMethodConfig .namespace,
153
137
TestData .SimpleMethodConfig .name, TestData .SimpleMethodConfig .snapshotId, methodConfigName, TestData .SimpleMethodConfig .rootEntityType)
154
138
val submissionDetailsPage = methodConfigDetailsPage.launchAnalysis(TestData .SimpleMethodConfig .rootEntityType, TestData .SingleParticipant .entityId)
155
139
assert(submissionDetailsPage.verifyWorkflowFailed())
140
+ }
141
+
142
+ " import a method config from a workspace" in withWebDriver { implicit driver =>
143
+
144
+ }
145
+
146
+ " import a method config into a workspace from the method repo" in withWebDriver { implicit driver =>
147
+
148
+ }
149
+
150
+ // negative tests
151
+
152
+ " delete a method config from a workspace" in withWebDriver { implicit driver =>
156
153
157
- val submissionSummaryPage = new WorkspaceSummaryPage (wsNamespace, wsName)
158
- submissionSummaryPage.open
159
- submissionSummaryPage.deleteWorkspace()
160
154
}
161
155
162
156
0 commit comments