-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e tests for app-with-rbac and app-with-service-account
- Loading branch information
Showing
15 changed files
with
226 additions
and
132 deletions.
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
12 changes: 5 additions & 7 deletions
12
...with-rbac/tests/appAuthentication.spec.ts → ...bac/tests/admin/appAuthentication.spec.ts
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 |
---|---|---|
@@ -1,17 +1,15 @@ | ||
import { test, expect } from './fixtures'; | ||
import { ROUTES } from '../src/constants'; | ||
import { test, expect } from '../fixtures'; | ||
import { ROUTES } from '../../src/constants'; | ||
|
||
test.describe('navigating app', () => { | ||
test('Page patents should be visible for admin', async ({ gotoPage, page }) => { | ||
// wait for page to successfully render | ||
await gotoPage('/hello'); | ||
await expect(page).toHaveURL(/.*patents/); | ||
await expect(page.getByText('Welcome')).toBeVisible(); | ||
await gotoPage(`/${ROUTES.Patents}`); | ||
await expect(page.getByText('Normally restricted to Administrators')).toBeVisible(); | ||
}); | ||
test('Page research docs should be visible for admin', async ({ gotoPage, page }) => { | ||
// wait for page to successfully render | ||
await gotoPage(`/${ROUTES.ResearchDocs}`); | ||
await expect(page).toHaveURL(/.*research/); | ||
await expect(page.getByText('Welcome')).toBeVisible(); | ||
await expect(page.getByText('Normally accessible to anyone')).toBeVisible(); | ||
}); | ||
}); |
15 changes: 15 additions & 0 deletions
15
examples/app-with-rbac/tests/viewer/appAuthenticationViewer.spec.ts
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,15 @@ | ||
import { test, expect } from '../fixtures'; | ||
import { ROUTES } from '../../src/constants'; | ||
|
||
test.describe('navigating app for Viewer', () => { | ||
test('Page patents should not be visible for viewer', async ({ gotoPage, page }) => { | ||
// wait for page to successfully render | ||
await gotoPage(`/${ROUTES.Patents}`); | ||
await expect(page.getByText('Normally restricted to Administrators')).not.toBeVisible(); | ||
}); | ||
test('Page research docs should be visible for viewer', async ({ gotoPage, page }) => { | ||
// wait for page to successfully render | ||
await gotoPage(`/${ROUTES.ResearchDocs}`); | ||
await expect(page.getByText('Normally accessible to anyone')).toBeVisible(); | ||
}); | ||
}); |
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
133 changes: 133 additions & 0 deletions
133
examples/app-with-service-account/provisioning/dashboards/dashboard.json
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,133 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": { | ||
"type": "grafana", | ||
"uid": "-- Grafana --" | ||
}, | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"editable": true, | ||
"fiscalYearStartMonth": 0, | ||
"graphTooltip": 0, | ||
"links": [], | ||
"liveNow": false, | ||
"panels": [ | ||
{ | ||
"datasource": { | ||
"type": "grafana-testdata-datasource", | ||
"uid": "PD8C576611E62080A" | ||
}, | ||
"fieldConfig": { | ||
"defaults": { | ||
"color": { | ||
"mode": "palette-classic" | ||
}, | ||
"custom": { | ||
"axisBorderShow": false, | ||
"axisCenteredZero": false, | ||
"axisColorMode": "text", | ||
"axisLabel": "", | ||
"axisPlacement": "auto", | ||
"barAlignment": 0, | ||
"drawStyle": "line", | ||
"fillOpacity": 0, | ||
"gradientMode": "none", | ||
"hideFrom": { | ||
"legend": false, | ||
"tooltip": false, | ||
"viz": false | ||
}, | ||
"insertNulls": false, | ||
"lineInterpolation": "linear", | ||
"lineWidth": 1, | ||
"pointSize": 5, | ||
"scaleDistribution": { | ||
"type": "linear" | ||
}, | ||
"showPoints": "auto", | ||
"spanNulls": false, | ||
"stacking": { | ||
"group": "A", | ||
"mode": "none" | ||
}, | ||
"thresholdsStyle": { | ||
"mode": "off" | ||
} | ||
}, | ||
"mappings": [], | ||
"thresholds": { | ||
"mode": "absolute", | ||
"steps": [ | ||
{ | ||
"color": "green", | ||
"value": null | ||
}, | ||
{ | ||
"color": "red", | ||
"value": 80 | ||
} | ||
] | ||
}, | ||
"unitScale": true | ||
}, | ||
"overrides": [] | ||
}, | ||
"gridPos": { | ||
"h": 8, | ||
"w": 12, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 1, | ||
"options": { | ||
"legend": { | ||
"calcs": [], | ||
"displayMode": "list", | ||
"placement": "bottom", | ||
"showLegend": true | ||
}, | ||
"tooltip": { | ||
"mode": "single", | ||
"sort": "none" | ||
} | ||
}, | ||
"targets": [ | ||
{ | ||
"datasource": { | ||
"type": "grafana-testdata-datasource", | ||
"uid": "PD8C576611E62080A" | ||
}, | ||
"refId": "A", | ||
"scenarioId": "random_walk", | ||
"seriesCount": 1 | ||
} | ||
], | ||
"title": "Panel Title", | ||
"type": "timeseries" | ||
} | ||
], | ||
"refresh": "", | ||
"schemaVersion": 39, | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-6h", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "", | ||
"title": "New dashboard", | ||
"version": 0, | ||
"weekStart": "" | ||
} |
7 changes: 7 additions & 0 deletions
7
examples/app-with-service-account/provisioning/dashboards/default.yaml
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,7 @@ | ||
apiVersion: 1 | ||
|
||
providers: | ||
- name: Default | ||
type: file | ||
options: | ||
path: /etc/grafana/provisioning/dashboards |
6 changes: 6 additions & 0 deletions
6
examples/app-with-service-account/provisioning/datasources/default.yaml
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,6 @@ | ||
apiVersion: 1 | ||
|
||
datasources: | ||
- name: gdev-testdata | ||
isDefault: true | ||
type: testdata |
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 |
---|---|---|
|
@@ -2,4 +2,6 @@ apiVersion: 1 | |
|
||
apps: | ||
- type: 'grafana-appwithserviceaccount-app' | ||
org_id: 1 | ||
org_name: Main Org. | ||
disabled: false |
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 was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
examples/app-with-service-account/tests/appNavigation.spec.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.