Skip to content

Commit

Permalink
[Cases] Serverless tests for Cases detail view (#164827)
Browse files Browse the repository at this point in the history
Connected with #164552

## Summary

This PR creates a serverless version of the tests currently in
`x-pack/test/functional_with_es_ssl/apps/cases/group1/view_case.ts`.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Janki Salvi <117571355+js-jankisalvi@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 7, 2023
1 parent 03f0cdc commit 3f18975
Show file tree
Hide file tree
Showing 18 changed files with 959 additions and 11 deletions.
1 change: 1 addition & 0 deletions x-pack/test/cases_api_integration/common/lib/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,7 @@ export const updateCase = async ({

const { body: cases } = await apiCall
.set('kbn-xsrf', 'true')
.set('x-elastic-internal-origin', 'foo')
.set(headers)
.send(params)
.expect(expectedHttpCode);
Expand Down
7 changes: 6 additions & 1 deletion x-pack/test/functional/services/cases/test_resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ export function CasesTestResourcesServiceProvider({ getService }: FtrProviderCon

return {
async installKibanaSampleData(sampleDataId: 'ecommerce' | 'flights' | 'logs') {
await supertest.post(`/api/sample_data/${sampleDataId}`).set('kbn-xsrf', 'true').expect(200);
await supertest
.post(`/api/sample_data/${sampleDataId}`)
.set('kbn-xsrf', 'true')
.set('x-elastic-internal-origin', 'foo')
.expect(200);
},

async removeKibanaSampleData(sampleDataId: 'ecommerce' | 'flights' | 'logs') {
await supertest
.delete(`/api/sample_data/${sampleDataId}`)
.set('kbn-xsrf', 'true')
.set('x-elastic-internal-origin', 'foo')
.expect(204);
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const cases = getService('cases');
const find = getService('find');

describe('persistable attachment', () => {
describe('Cases persistable attachments', () => {
describe('lens visualization', () => {
before(async () => {
await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/logstash_functional');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const cases = getService('cases');
const toasts = getService('toasts');

describe('Configure', function () {
describe('Configure Case', function () {
before(async () => {
await svlObltNavigation.navigateToLandingPage();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { navigateToCasesApp } from '../../../../shared/lib/cases';
const owner = OBSERVABILITY_OWNER;

export default ({ getService, getPageObject }: FtrProviderContext) => {
describe('Create case', function () {
describe('Create Case', function () {
const find = getService('find');
const cases = getService('cases');
const testSubjects = getService('testSubjects');
Expand Down
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const svlCommonNavigation = getPageObject('svlCommonNavigation');
const svlObltNavigation = getService('svlObltNavigation');

describe('cases list', () => {
describe('Cases list', () => {
before(async () => {
await svlObltNavigation.navigateToLandingPage();
await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'observability-overview:cases' });
Expand Down
Loading

0 comments on commit 3f18975

Please sign in to comment.