Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
aa77fcad
Unverified
Commit
aa77fcad
authored
4 years ago
by
Nemanja Glumac
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix check for disabled button in `add.cy.spec.js` (#14833)
parent
17e3223e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
frontend/test/metabase/scenarios/admin/databases/add.cy.spec.js
+11
-13
11 additions, 13 deletions
...nd/test/metabase/scenarios/admin/databases/add.cy.spec.js
with
11 additions
and
13 deletions
frontend/test/metabase/scenarios/admin/databases/add.cy.spec.js
+
11
−
13
View file @
aa77fcad
...
...
@@ -43,12 +43,11 @@ describe("scenarios > admin > databases > add", () => {
typeField
(
"
Database name
"
,
"
test_postgres_db
"
);
typeField
(
"
Username
"
,
"
uberadmin
"
);
cy
.
findBy
Text
(
"
Save
"
)
cy
.
findBy
Role
(
"
button
"
,
{
name
:
"
Save
"
}
)
.
should
(
"
not.be.disabled
"
)
.
click
();
cy
.
wait
(
"
@createDatabase
"
);
cy
.
url
().
should
(
"
match
"
,
/
\/
admin
\/
databases
\?
created=42$/
);
});
...
...
@@ -59,11 +58,13 @@ describe("scenarios > admin > databases > add", () => {
typeField
(
"
Database name
"
,
"
test_postgres_db
"
);
typeField
(
"
Username
"
,
"
uberadmin
"
);
cy
.
findByText
(
"
Save
"
).
should
(
"
not.be.disabled
"
);
cy
.
findByRole
(
"
button
"
,
{
name
:
"
Save
"
})
.
should
(
"
not.be.disabled
"
)
.
click
();
toggleFieldWithDisplayName
(
"
let me choose when Metabase syncs and scans
"
);
cy
.
findBy
Text
(
"
Next
"
)
cy
.
findBy
Role
(
"
button
"
,
{
name
:
"
Next
"
}
)
.
should
(
"
not.be.disabled
"
)
.
click
();
...
...
@@ -82,17 +83,17 @@ describe("scenarios > admin > databases > add", () => {
typeField
(
"
Database name
"
,
"
test_postgres_db
"
);
typeField
(
"
Username
"
,
"
uberadmin
"
);
cy
.
findBy
Text
(
"
Save
"
).
should
(
"
not.be.disabled
"
);
cy
.
findBy
Role
(
"
button
"
,
{
name
:
"
Save
"
}
).
should
(
"
not.be.disabled
"
);
toggleFieldWithDisplayName
(
"
let me choose when Metabase syncs and scans
"
);
cy
.
findBy
Text
(
"
Next
"
)
cy
.
findBy
Role
(
"
button
"
,
{
name
:
"
Next
"
}
)
.
should
(
"
not.be.disabled
"
)
.
click
();
cy
.
findByText
(
"
Never, I'll do this manually if I need to
"
).
click
();
cy
.
findBy
Text
(
"
Save
"
).
click
();
cy
.
findBy
Role
(
"
button
"
,
{
name
:
"
Save
"
}
).
click
();
cy
.
wait
(
"
@createDatabase
"
).
then
(({
request
})
=>
{
expect
(
request
.
body
.
engine
).
to
.
equal
(
"
postgres
"
);
...
...
@@ -101,8 +102,7 @@ describe("scenarios > admin > databases > add", () => {
});
cy
.
url
().
should
(
"
match
"
,
/
\/
admin
\/
databases
\?
created=42$/
);
cy
.
findByText
(
"
Your database has been added!
"
).
should
(
"
exist
"
);
cy
.
findByText
(
"
Your database has been added!
"
);
});
it
(
"
should show error correctly on server error
"
,
()
=>
{
...
...
@@ -120,10 +120,9 @@ describe("scenarios > admin > databases > add", () => {
typeField
(
"
Database name
"
,
"
test_postgres_db
"
);
typeField
(
"
Username
"
,
"
uberadmin
"
);
cy
.
findBy
Text
(
"
Save
"
).
click
();
cy
.
findBy
Role
(
"
button
"
,
{
name
:
"
Save
"
}
).
click
();
cy
.
wait
(
"
@createDatabase
"
);
cy
.
findByText
(
"
DATABASE CONNECTION ERROR
"
).
should
(
"
exist
"
);
});
...
...
@@ -167,7 +166,7 @@ describe("scenarios > admin > databases > add", () => {
}).
as
(
"
createDatabase
"
);
// submit form and check that the file's body is included
cy
.
contains
(
"
Save
"
).
click
();
cy
.
findByRole
(
"
button
"
,
{
name
:
"
Save
"
}
).
click
();
cy
.
wait
(
"
@createDatabase
"
).
should
(
xhr
=>
{
expect
(
xhr
.
request
.
body
.
details
[
"
service-account-json
"
]).
to
.
equal
(
'
{"foo": 123}
'
,
...
...
@@ -197,7 +196,6 @@ describe("scenarios > admin > databases > add", () => {
cy
.
visit
(
"
/admin/databases/123
"
);
cy
.
contains
(
"
Connect to a Service Account instead
"
);
cy
.
contains
(
"
generate a Client ID and Client Secret for your project
"
);
});
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment