Skip to content
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

Simplify api response info for FF tests #1664

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -132,20 +132,8 @@ describe('Creating Workflows Using Various Methods', () => {
.should('be.visible')
.click();
cy.fixture(FF_FIXTURE_BASE_PATH + 'semantic_search/ingest_response').then(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tyler, In the fixture please remove filesemantic_search/ingest_response. As it is no longer used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer to leave actually, so we're mocking correctly. Also, it actually is still required, as once ingest responses are returned, we have logic to to open up and auto-switch tabs to ingest or search, so the visibility check is still valid.

In the future, we may add some more flexible logic to parse out the responses and ensure there are visible parts in them as well.

(expectedJson) => {
cy.get('#tools_panel_id .ace_editor .ace_content')
.should('be.visible')
.invoke('text')
.then((editorText) => {
expect(editorText).to.include(`"took": ${expectedJson.took}`);
expect(editorText).to.include(
`"ingest_took": ${expectedJson.ingest_took}`
);
expect(editorText).to.include(`"errors": ${expectedJson.errors}`);
expect(editorText).to.include(
`"result": "${expectedJson.items[0].index.result}"`
);
});
() => {
cy.get('#tools_panel_id').should('be.visible');
}
);
cy.getElementByDataTestId('searchPipelineButton')
Expand Down Expand Up @@ -182,16 +170,8 @@ describe('Creating Workflows Using Various Methods', () => {
.click();

cy.fixture(FF_FIXTURE_BASE_PATH + 'semantic_search/search_response').then(
ohltyler marked this conversation as resolved.
Show resolved Hide resolved
(expectedSearchJson) => {
cy.get('#tools_panel_id .ace_editor .ace_content')
.should('be.visible')
.invoke('text')
.then((editorText) => {
const editorJson = JSON.parse(editorText);
expect(JSON.stringify(editorJson)).to.contain(
JSON.stringify(expectedSearchJson['hits']['hits'][0]['_source'])
);
});
() => {
cy.get('#tools_panel_id').should('be.visible');
}
);
});
Expand Down
Loading