Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const fillQueryEditor = () => {
// Fill in the Query Editor with data needed
// We are specifically looking at Releases with `grafana` repo to ensure we don't have any
// sensitive info that will be caught by the screenshot
e2e.components.QueryEditorRows.rows()
.should('be.visible')
.within(() => {
e2e.components.Select.input()
.first()
.should('be.empty')
.focus()
.type(`Releases{enter}`);
});
e2eSelectors.QueryEditor.Owner.input()
.should('be.empty')
.type(`grafana{enter}`);
e2eSelectors.QueryEditor.Repository.input()
.should('be.empty')
.type(`grafana{enter}`);
};
const fillSpreadsheetID = (newValue: string, previousValue = 'Enter SpreadsheetID', avoidFlakiness = false) =>
e2e.components.QueryEditorRows.rows()
.contains('.gf-form-inline', 'Spreadsheet ID')
.within(() => {
e2e()
.get(`.gf-form:has(.gf-form-label:contains("${previousValue}"))`) // the <label>
.click({ force: avoidFlakiness });
e2e()
.get('input')
.scrollIntoView()
.type(`${newValue}{enter}`);
});
</label>
.within(() => {
e2e.components.Select.input()
.first()
.should('be.empty')
.focus()
.type(`Releases{enter}`);
});