-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update tests to support Grafana 10 #222
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const Selectors = { | ||
SetupForm: { | ||
name: 'input[id="basic-settings-name"]', | ||
url: '[data-test-id="checkmk-url"]', | ||
edition: 'input[id="checkmk-edition"]', | ||
username: '[data-test-id="checkmk-username"]', | ||
password: '[data-test-id="checkmk-password"]', | ||
version: '[id="checkmk-version"]', | ||
}, | ||
AddDashboard: { | ||
filterFieldId: 'input_add_filter', | ||
hostLabelFieldId: 'input_host_label', | ||
}, | ||
}; | ||
|
||
export default Selectors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const grafanaVersion = 10; | ||
|
||
const addDataSourceSaveAndTestButtonV9 = 'button[aria-label="Data source settings page Save and Test button"]'; | ||
const addDataSourceSaveAndTestButtonV10 = `button[data-testid="data-testid Data source settings page Save and Test button"]`; | ||
|
||
const addNewPanelButtonV9 = 'button[aria-label="Add new panel"]'; | ||
const addNewPanelButtonV10 = 'button[data-testid="data-testid Create new panel button"]'; | ||
|
||
const Selectors = { | ||
grafanaVersion, | ||
Login: { | ||
username_input: 'input[name="user"]', | ||
password_input: 'input[name="password"]', | ||
login_button: 'button[aria-label="Login button"]', | ||
}, | ||
|
||
AddDataSource: { | ||
select_datasource_button: (name: string): string => `button[aria-label="${`Add new data source ${name}`}"]`, | ||
save_and_test_button: grafanaVersion >= 10 ? addDataSourceSaveAndTestButtonV10 : addDataSourceSaveAndTestButtonV9, | ||
}, | ||
|
||
AddDashboard: { | ||
add_new_panel_button: grafanaVersion >= 10 ? addNewPanelButtonV10 : addNewPanelButtonV9, | ||
datasources_list: 'div[data-testid="data-sources-list"]', | ||
}, | ||
}; | ||
|
||
export default Selectors; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,6 @@ | |
"author": "", | ||
"license": "GPL-2.0-only", | ||
"devDependencies": { | ||
"cypress": "^12.11.0" | ||
"cypress": "13.3.3" | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you looked into @grafana/e2e-selectors if this could help us in the long run?
i would be okay with updating this dependency to 10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using @grafana/e2e-selectors but they were not working with Cypress tests, so I did a workaround. I need to explore it a little more