Skip to content

Commit

Permalink
More test stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-tavares committed Jun 14, 2020
1 parent 3c59c79 commit 61f519d
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,25 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
it('should redirect user back to Policy List if Cancel button is clicked', async () => {
await (await pageObjects.ingestManagerCreateDatasource.findCancelButton()).click();

// FIXME: need method to chec that is on policy list page.
});
it('should redirect user back to Policy List if Back link is clicked', async () => {
await (await pageObjects.ingestManagerCreateDatasource.findBackLink()).click();

// FIXME: need method to chec that is on policy list page.
// TODO test case
expect(true).to.be(false);
});
it('should display custom endpoint configuration message', async () => {
await pageObjects.ingestManagerCreateDatasource.selectAgentConfig();
const endpointConfig = await pageObjects.policy.findDatasourceEndpointCustomConfiguration();
expect(endpointConfig).not.to.be(undefined);
});
it('should redirect user back to Policy List after a successful save', async () => {
// TODO test case
expect(true).to.be(false);
});
it('should redirect user back to Policy List if Back link is clicked', async () => {});
it('should redirect user back to Policy List after a successful save', async () => {});
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { FtrProviderContext } from '../ftr_provider_context';

export function IngestManagerCreateDatasource({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const find = getService('find');

return {
/**
Expand All @@ -31,13 +32,34 @@ export function IngestManagerCreateDatasource({ getService }: FtrProviderContext
return await testSubjects.find('createDataSource_cancelBackLink');
},

async selectAgentConfig(name?: string) {},

/**
* Finds and returns the save button on the sticky bottom bar
*/
async findDSaveButton() {
return await testSubjects.find('createDatasourceSaveButton');
},

/**
* Selects an agent configuration on the form
* @param name
* Visual name of the configuration. if one is not provided, the first agent
* configuration on the list will be chosen
*/
async selectAgentConfig(name?: string) {
// if we have a name, then find the button with that `title` set.
if (name) {
// FIXME implement
}
// Else, just select the first agent configuration that is present
else {
await (await find.byCssSelector('button[]')).click();
}
},

/**
* Set the name of the datasource on the input field
* @param name
*/
async setDatasourceName(name: string) {},
};
}

0 comments on commit 61f519d

Please sign in to comment.