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

[Exploratory View] Adds "Add to case" button #112463

Merged
merged 17 commits into from
Sep 30, 2021

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Sep 16, 2021

Summary

Fix elastic/uptime#322

Added a "Add to case" button in exploratory view

image

Once user clicks it, it will show a modal
image

Once user selects the case, after loading

we can see the toast

image

In the toast if you click view case, it will leads you to the case and you can see the viz added in the comments

image

@shahzad31 shahzad31 marked this pull request as ready for review September 16, 2021 18:40
@shahzad31 shahzad31 requested a review from a team as a code owner September 16, 2021 18:40
@shahzad31 shahzad31 self-assigned this Sep 16, 2021
@shahzad31 shahzad31 added release_note:feature Makes this part of the condensed release notes v7.16.0 v8.0.0 labels Sep 16, 2021
@shahzad31
Copy link
Contributor Author

@elasticmachine merge upstream

@drewpost
Copy link

I think this looks good @shahzad31 - a great one to get in for the 7.16 GA, for sure! I'd be curious to see if @liciavale thinks we should create an "Actions" button that has open in lens and add to case with it given the upcoming actions of "share", "save" etc in future iterations.

@shahzad31
Copy link
Contributor Author

@elasticmachine merge upstream

@shahzad31 shahzad31 added the Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability label Sep 23, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/uptime (Team:uptime)

@liciavale
Copy link
Contributor

I think this looks good @shahzad31 - a great one to get in for the 7.16 GA, for sure! I'd be curious to see if @liciavale thinks we should create an "Actions" button that has open in lens and add to case with it given the upcoming actions of "share", "save" etc in future iterations.

Yes, let's consider this when we add other actions.

@shahzad31
Copy link
Contributor Author

@elasticmachine merge upstream

const { cases, http } = kServices;

const getToastText = useCallback(
(thaCase) => toMountPoint(<CaseToastText theCase={thaCase} basePath={http.basePath.get()} />),
Copy link
Contributor

Choose a reason for hiding this comment

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

What does toMountPoint do?

Should thaCase be theCase? If not, what does tha mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

toMountPoint is a util exposed by kibana when you need work with toasts etc and you need to mount react elements.

it('should return expected result', async function () {
const { setData, core, findByText } = setupTestComponent();

expect(setData).toHaveBeenLastCalledWith({
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason you can't use renderHook to test this, instead of creating your own helper component?

To me it seems this is partially testing your helper component, since set data and when/how it's called isn't part of the actual hook. It seems like you're wanting to just test the result object.

Using renderHook you could pass the appropriate hook props and test that the result object matches your expectation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i need contexts on top of hook render for this to work, render from rtl utility already has those context as wrapper in.

for example that hook uses useKibana inside, if i wanted to use renderHook, i had to mock all those hooks separately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if this fits your use case, but you can also use the wrapper option to wrap the hooks in providers. Could take one of the provider wrapper in our rtl helpers and wrap it with. But I see what you did here.

https://react-hooks-testing-library.com/usage/advanced-hooks

[navigateToApp]
);

const onCaseClicked = useCallback(
Copy link
Contributor

Choose a reason for hiding this comment

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

You can define this as a async function rather than using .then syntax.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i actually wanted to add error handling here. i find erro handling in this pattern much more readable as compared to try/catch approach with await.

);
});
} else {
navigateToApp(appId, {
Copy link
Contributor

Choose a reason for hiding this comment

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

onCaseClick should only be applied to a button if theCase and lensAttributes are truthy. Is this condition desired?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes this condition is actually for the cases modal, if there will be no theCase , clicking on add button in the case modal will take you to create case. it's weird but this is how that modal works.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's cool, i will probably extend rtl helpers for a use case like this in future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me know if this is blocking for this PR @dominiqueclarke

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

After changing report type, Add To Case button no longer works

  1. Click Add To Case Button
  2. Exit Add To Case modal
  3. Change report type
  4. Click Add To Case button again
  5. Notice that Add To Case button no longer works

Add to case modal pops up when changing report config.

  1. Using Synthetics Monitoring -> KPI Over Time as an example, set a value for monitor name
  2. Click Add To Case Button
  3. Exit Add To Case modal
  4. Remove monitor name
  5. Add monitor name again
  6. Notice that the modal pops up again, even when you don't click the button.

It's a shame that you can open up the visualization in lens, but not in exploratory view. Assuming this is out of scope, but is there any way to add an additional option to open in exploratory view? EDIT: I'm realizing now that this is part of the AC for associated issue.
Screen Shot 2021-09-27 at 10 30 47 AM

@shahzad31
Copy link
Contributor Author

After changing report type, Add To Case button no longer works

  1. Click Add To Case Button
  2. Exit Add To Case modal
  3. Change report type
  4. Click Add To Case button again
  5. Notice that Add To Case button no longer works

Add to case modal pops up when changing report config.

  1. Using Synthetics Monitoring -> KPI Over Time as an example, set a value for monitor name
  2. Click Add To Case Button
  3. Exit Add To Case modal
  4. Remove monitor name
  5. Add monitor name again
  6. Notice that the modal pops up again, even when you don't click the button.

It's a shame that you can open up the visualization in lens, but not in exploratory view. Assuming this is out of scope, but is there any way to add an additional option to open in exploratory view? EDIT: I'm realizing now that this is part of the AC for associated issue. Screen Shot 2021-09-27 at 10 30 47 AM

@dominiqueclarke i have fixed this issue

@kibanamachine
Copy link
Contributor

💛 Build succeeded, but was flaky


Test Failures

Kibana Pipeline / general / X-Pack Reporting Functional Tests With Deprecated Roles config.x-pack/test/reporting_functional/reporting_and_deprecated_security/security_roles_privileges·ts.Reporting Functional Tests with Deprecated Security configuration enabled Security with `reporting_user` built-in role Visualize Editor: Generate Screenshot does allow user with reporting_user role

Link to Jenkins

Standard Out

Failed Tests Reporter:
  - Test has not failed recently on tracked branches

[00:00:00]                     │
[00:00:00]                       └-: Reporting Functional Tests with Deprecated Security configuration enabled
[00:00:00]                         └-> "before all" hook in "Reporting Functional Tests with Deprecated Security configuration enabled"
[00:00:00]                         └-> "before all" hook in "Reporting Functional Tests with Deprecated Security configuration enabled"
[00:00:00]                           │ debg creating role data_analyst
[00:00:00]                           │ info [o.e.x.s.a.r.TransportPutRoleAction] [node-01] added role [data_analyst]
[00:00:00]                           │ debg creating user data_analyst
[00:00:00]                           │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [data_analyst]
[00:00:00]                           │ debg created user data_analyst
[00:00:00]                           │ debg creating user reporting_user
[00:00:00]                           │ info [o.e.x.s.a.u.TransportPutUserAction] [node-01] added user [reporting_user]
[00:00:00]                           │ debg created user reporting_user
[00:00:00]                         └-: Security with `reporting_user` built-in role
[00:00:00]                           └-> "before all" hook in "Security with `reporting_user` built-in role"
[00:00:00]                           └-> "before all" hook in "Security with `reporting_user` built-in role"
[00:00:00]                             │ info [x-pack/test/functional/es_archives/reporting/ecommerce] Loading "mappings.json"
[00:00:00]                             │ info [x-pack/test/functional/es_archives/reporting/ecommerce] Loading "data.json.gz"
[00:00:00]                             │ info [o.e.c.m.MetadataCreateIndexService] [node-01] [ecommerce] creating index, cause [api], templates [], shards [1]/[0]
[00:00:00]                             │ info [o.e.c.r.a.AllocationService] [node-01] current.health="GREEN" message="Cluster health status changed from [YELLOW] to [GREEN] (reason: [shards started [[ecommerce][0]]])." previous.health="YELLOW" reason="shards started [[ecommerce][0]]"
[00:00:00]                             │ info [x-pack/test/functional/es_archives/reporting/ecommerce] Created index "ecommerce"
[00:00:00]                             │ debg [x-pack/test/functional/es_archives/reporting/ecommerce] "ecommerce" settings {"index":{"number_of_replicas":"0","number_of_shards":"1"}}
[00:00:02]                             │ info [x-pack/test/functional/es_archives/reporting/ecommerce] Indexed 4675 docs into "ecommerce"
[00:00:03]                             │ debg resolved import for x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json to /dev/shm/workspace/parallel/9/kibana/x-pack/test/functional/fixtures/kbn_archiver/reporting/ecommerce.json
[00:00:03]                             │ info importing 13 saved objects { space: undefined }
[00:00:03]                             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/uIP5xJ2BRQGLjBGInBAAhg] update_mapping [_doc]
[00:00:03]                             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/uIP5xJ2BRQGLjBGInBAAhg] update_mapping [_doc]
[00:00:03]                             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/uIP5xJ2BRQGLjBGInBAAhg] update_mapping [_doc]
[00:00:03]                             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/uIP5xJ2BRQGLjBGInBAAhg] update_mapping [_doc]
[00:00:03]                             │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/uIP5xJ2BRQGLjBGInBAAhg] update_mapping [_doc]
[00:00:03]                             │ succ import success
[00:03:57]                           └-: Visualize Editor: Generate Screenshot
[00:03:57]                             └-> "before all" hook for "does not allow user that does not have reporting_user role"
[00:03:57]                             └-> does not allow user that does not have reporting_user role
[00:03:57]                               └-> "before each" hook: global before each for "does not allow user that does not have reporting_user role"
[00:03:57]                               │ debg SecurityPage.forceLogout
[00:03:57]                               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=100
[00:03:58]                               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:03:58]                               │ debg Redirecting to /logout to force the logout
[00:03:58]                               │ debg Waiting on the login form to appear
[00:03:58]                               │ debg Waiting for Login Page to appear.
[00:03:58]                               │ debg Waiting up to 100000ms for login page...
[00:03:58]                               │ debg browser[INFO] http://localhost:6191/logout?_t=1632838457119 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:03:58]                               │
[00:03:58]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:03:58]                               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:04:02]                               │ debg browser[INFO] http://localhost:6191/login?msg=LOGGED_OUT 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:02]                               │
[00:04:02]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:02]                               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:04:02]                               │ERROR browser[SEVERE] http://localhost:6191/api/licensing/info - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:04:03]                               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:04:03]                               │ debg TestSubjects.exists(loginForm)
[00:04:03]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="loginForm"]') with timeout=2500
[00:04:03]                               │ debg Waiting for Login Form to appear.
[00:04:03]                               │ debg Waiting up to 100000ms for login form...
[00:04:03]                               │ debg TestSubjects.exists(loginForm)
[00:04:03]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="loginForm"]') with timeout=2500
[00:04:03]                               │ debg TestSubjects.setValue(loginUsername, data_analyst)
[00:04:03]                               │ debg TestSubjects.click(loginUsername)
[00:04:03]                               │ debg Find.clickByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:04:03]                               │ debg Find.findByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:04:03]                               │ debg TestSubjects.setValue(loginPassword, data_analyst-password)
[00:04:03]                               │ debg TestSubjects.click(loginPassword)
[00:04:03]                               │ debg Find.clickByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:04:03]                               │ debg Find.findByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:04:03]                               │ debg TestSubjects.click(loginSubmit)
[00:04:03]                               │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:04:03]                               │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:04:03]                               │ debg Waiting for login result, expected: undefined.
[00:04:03]                               │ debg Waiting up to 20000ms for logout button visible...
[00:04:03]                               │ debg TestSubjects.exists(userMenuButton)
[00:04:03]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenuButton"]') with timeout=2500
[00:04:03]                               │ proc [kibana]   log   [14:14:22.276] [info][plugins][routes][security] Logging in with provider "basic" (basic)
[00:04:05]                               │ debg browser[INFO] http://localhost:6191/app/home 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:05]                               │
[00:04:05]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:05]                               │ debg TestSubjects.exists(userMenu)
[00:04:05]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"]') with timeout=2500
[00:04:08]                               │ debg --- retry.tryForTime error: [data-test-subj="userMenu"] is not displayed
[00:04:08]                               │ debg TestSubjects.click(userMenuButton)
[00:04:08]                               │ debg Find.clickByCssSelector('[data-test-subj="userMenuButton"]') with timeout=10000
[00:04:08]                               │ debg Find.findByCssSelector('[data-test-subj="userMenuButton"]') with timeout=10000
[00:04:08]                               │ debg TestSubjects.exists(userMenu)
[00:04:08]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"]') with timeout=120000
[00:04:09]                               │ debg TestSubjects.exists(userMenu > logoutLink)
[00:04:09]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"] [data-test-subj="logoutLink"]') with timeout=2500
[00:04:09]                               │ debg Opening saved visualizatiton: e-commerce pie chart
[00:04:09]                               │ debg navigating to visualize url: http://localhost:6191/app/visualize#/
[00:04:09]                               │ debg navigate to: http://localhost:6191/app/visualize#/
[00:04:09]                               │ debg browser[INFO] http://localhost:6191/app/visualize?_t=1632838467679#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:09]                               │
[00:04:09]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:09]                               │ debg ... sleep(700) start
[00:04:09]                               │ debg ... sleep(700) end
[00:04:09]                               │ debg returned from get, calling refresh
[00:04:10]                               │ debg browser[INFO] http://localhost:6191/app/visualize?_t=1632838467679#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:10]                               │
[00:04:10]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:11]                               │ debg currentUrl = http://localhost:6191/app/visualize#/
[00:04:11]                               │          appUrl = http://localhost:6191/app/visualize#/
[00:04:11]                               │ debg TestSubjects.find(kibanaChrome)
[00:04:11]                               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:04:11]                               │ debg ... sleep(501) start
[00:04:11]                               │ debg ... sleep(501) end
[00:04:11]                               │ debg in navigateTo url = http://localhost:6191/app/visualize#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:04:11]                               │ debg --- retry.tryForTime error: URL changed, waiting for it to settle
[00:04:12]                               │ debg ... sleep(501) start
[00:04:12]                               │ debg ... sleep(501) end
[00:04:12]                               │ debg in navigateTo url = http://localhost:6191/app/visualize#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-15m,to:now))
[00:04:12]                               │ debg TestSubjects.click(visListingTitleLink-e-commerce-pie-chart)
[00:04:12]                               │ debg Find.clickByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:04:12]                               │ debg Find.findByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:04:12]                               │ debg isGlobalLoadingIndicatorVisible
[00:04:12]                               │ debg TestSubjects.exists(globalLoadingIndicator)
[00:04:12]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="globalLoadingIndicator"]') with timeout=1500
[00:04:14]                               │ debg --- retry.tryForTime error: [data-test-subj="globalLoadingIndicator"] is not displayed
[00:04:14]                               │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/cxYIFF2CT0OwGozWHcwTQw] update_mapping [_doc]
[00:04:14]                               │ debg TestSubjects.exists(globalLoadingIndicator-hidden)
[00:04:14]                               │ debg Find.existsByCssSelector('[data-test-subj="globalLoadingIndicator-hidden"]') with timeout=100000
[00:04:14]                               │ debg openPdfReportingPanel
[00:04:14]                               │ debg openShareMenuItem title:PDF Reports
[00:04:14]                               │ debg TestSubjects.exists(shareContextMenu)
[00:04:14]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="shareContextMenu"]') with timeout=2500
[00:04:17]                               │ debg --- retry.tryForTime error: [data-test-subj="shareContextMenu"] is not displayed
[00:04:17]                               │ debg TestSubjects.click(shareTopNavButton)
[00:04:17]                               │ debg Find.clickByCssSelector('[data-test-subj="shareTopNavButton"]') with timeout=10000
[00:04:17]                               │ debg Find.findByCssSelector('[data-test-subj="shareTopNavButton"]') with timeout=10000
[00:04:18]                               │ debg Find.findByCssSelector('div.euiContextMenuPanel') with timeout=10000
[00:04:18]                               │ debg TestSubjects.click(sharePanel-PDFReports)
[00:04:18]                               │ debg Find.clickByCssSelector('[data-test-subj="sharePanel-PDFReports"]') with timeout=10000
[00:04:18]                               │ debg Find.findByCssSelector('[data-test-subj="sharePanel-PDFReports"]') with timeout=10000
[00:04:18]                               │ debg Find.waitForElementStale with timeout=10000
[00:04:18]                               │ debg TestSubjects.click(generateReportButton)
[00:04:18]                               │ debg Find.clickByCssSelector('[data-test-subj="generateReportButton"]') with timeout=10000
[00:04:18]                               │ debg Find.findByCssSelector('[data-test-subj="generateReportButton"]') with timeout=10000
[00:04:18]                               │ debg TestSubjects.exists(errorToastMessage)
[00:04:18]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="errorToastMessage"]') with timeout=2500
[00:04:18]                               │ERROR browser[SEVERE] http://localhost:6191/api/reporting/generate/printablePdfV2 - Failed to load resource: the server responded with a status of 403 (Forbidden)
[00:04:18]                               └- ✓ pass  (20.7s) "Reporting Functional Tests with Deprecated Security configuration enabled Security with `reporting_user` built-in role Visualize Editor: Generate Screenshot does not allow user that does not have reporting_user role"
[00:04:18]                             └-> does allow user with reporting_user role
[00:04:18]                               └-> "before each" hook: global before each for "does allow user with reporting_user role"
[00:04:18]                               │ debg SecurityPage.forceLogout
[00:04:18]                               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=100
[00:04:18]                               │ info [o.e.c.m.MetadataMappingService] [node-01] [.kibana_8.0.0_001/cxYIFF2CT0OwGozWHcwTQw] update_mapping [_doc]
[00:04:18]                               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:04:19]                               │ debg Redirecting to /logout to force the logout
[00:04:19]                               │ debg Waiting on the login form to appear
[00:04:19]                               │ debg Waiting for Login Page to appear.
[00:04:19]                               │ debg Waiting up to 100000ms for login page...
[00:04:19]                               │ debg browser[INFO] http://localhost:6191/logout?_t=1632838477787 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:19]                               │
[00:04:19]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:19]                               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:04:21]                               │ debg browser[INFO] http://localhost:6191/login?msg=LOGGED_OUT 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:21]                               │
[00:04:21]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:21]                               │ debg --- retry.tryForTime error: .login-form is not displayed
[00:04:22]                               │ERROR browser[SEVERE] http://localhost:6191/api/licensing/info - Failed to load resource: the server responded with a status of 401 (Unauthorized)
[00:04:22]                               │ debg Find.existsByDisplayedByCssSelector('.login-form') with timeout=2500
[00:04:22]                               │ debg TestSubjects.exists(loginForm)
[00:04:22]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="loginForm"]') with timeout=2500
[00:04:22]                               │ debg Waiting for Login Form to appear.
[00:04:22]                               │ debg Waiting up to 100000ms for login form...
[00:04:22]                               │ debg TestSubjects.exists(loginForm)
[00:04:22]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="loginForm"]') with timeout=2500
[00:04:22]                               │ debg TestSubjects.setValue(loginUsername, reporting_user)
[00:04:22]                               │ debg TestSubjects.click(loginUsername)
[00:04:22]                               │ debg Find.clickByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:04:22]                               │ debg Find.findByCssSelector('[data-test-subj="loginUsername"]') with timeout=10000
[00:04:23]                               │ debg TestSubjects.setValue(loginPassword, reporting_user-password)
[00:04:23]                               │ debg TestSubjects.click(loginPassword)
[00:04:23]                               │ debg Find.clickByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:04:23]                               │ debg Find.findByCssSelector('[data-test-subj="loginPassword"]') with timeout=10000
[00:04:23]                               │ debg TestSubjects.click(loginSubmit)
[00:04:23]                               │ debg Find.clickByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:04:23]                               │ debg Find.findByCssSelector('[data-test-subj="loginSubmit"]') with timeout=10000
[00:04:23]                               │ debg Waiting for login result, expected: undefined.
[00:04:23]                               │ debg Waiting up to 20000ms for logout button visible...
[00:04:23]                               │ debg TestSubjects.exists(userMenuButton)
[00:04:23]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenuButton"]') with timeout=2500
[00:04:23]                               │ proc [kibana]   log   [14:14:41.992] [info][plugins][routes][security] Logging in with provider "basic" (basic)
[00:04:25]                               │ debg browser[INFO] http://localhost:6191/app/home 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:25]                               │
[00:04:25]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:25]                               │ debg TestSubjects.exists(userMenu)
[00:04:25]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"]') with timeout=2500
[00:04:28]                               │ debg --- retry.tryForTime error: [data-test-subj="userMenu"] is not displayed
[00:04:28]                               │ debg TestSubjects.click(userMenuButton)
[00:04:28]                               │ debg Find.clickByCssSelector('[data-test-subj="userMenuButton"]') with timeout=10000
[00:04:28]                               │ debg Find.findByCssSelector('[data-test-subj="userMenuButton"]') with timeout=10000
[00:04:28]                               │ debg TestSubjects.exists(userMenu)
[00:04:28]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"]') with timeout=120000
[00:04:28]                               │ debg TestSubjects.exists(userMenu > logoutLink)
[00:04:28]                               │ debg Find.existsByDisplayedByCssSelector('[data-test-subj="userMenu"] [data-test-subj="logoutLink"]') with timeout=2500
[00:04:28]                               │ debg Opening saved visualizatiton: e-commerce pie chart
[00:04:28]                               │ debg navigating to visualize url: http://localhost:6191/app/visualize#/
[00:04:28]                               │ debg navigate to: http://localhost:6191/app/visualize#/
[00:04:29]                               │ debg browser[INFO] http://localhost:6191/app/visualize?_t=1632838487573#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:29]                               │
[00:04:29]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:29]                               │ debg ... sleep(700) start
[00:04:29]                               │ debg ... sleep(700) end
[00:04:29]                               │ debg returned from get, calling refresh
[00:04:30]                               │ debg browser[INFO] http://localhost:6191/app/visualize?_t=1632838487573#/ 281 Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'unsafe-eval' 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-P5polb1UreUSOe5V/Pv7tc+yeZuJXiOi/3fqhGsU7BE='), or a nonce ('nonce-...') is required to enable inline execution.
[00:04:30]                               │
[00:04:30]                               │ debg browser[INFO] http://localhost:6191/bootstrap.js 41:19 "^ A single error about an inline script not firing due to content security policy is expected!"
[00:04:30]                               │ debg currentUrl = http://localhost:6191/app/visualize#/
[00:04:30]                               │          appUrl = http://localhost:6191/app/visualize#/
[00:04:30]                               │ debg TestSubjects.find(kibanaChrome)
[00:04:30]                               │ debg Find.findByCssSelector('[data-test-subj="kibanaChrome"]') with timeout=60000
[00:04:31]                               │ERROR browser[SEVERE] http://localhost:6191/api/licensing/info - Failed to load resource: net::ERR_NETWORK_CHANGED
[00:04:31]                               │ERROR browser[SEVERE] http://localhost:6191/api/saved_objects/_find?fields=title&fields=type&fields=typeMeta&per_page=10000&type=index-pattern - Failed to load resource: net::ERR_NETWORK_CHANGED
[00:04:31]                               │ERROR browser[SEVERE] http://localhost:6191/46566/bundles/core/core.entry.js 7:30933 TypeError: Failed to fetch
[00:04:31]                               │          at fetch_Fetch.fetchResponse (http://localhost:6191/46566/bundles/core/core.entry.js:1:31896)
[00:04:31]                               │          at async http://localhost:6191/46566/bundles/core/core.entry.js:1:30486
[00:04:31]                               │          at async http://localhost:6191/46566/bundles/core/core.entry.js:1:30443
[00:04:31]                               │ERROR browser[SEVERE] http://localhost:6191/internal/global_search/searchable_types - Failed to load resource: net::ERR_NETWORK_CHANGED
[00:04:31]                               │ debg ... sleep(501) start
[00:04:31]                               │ debg browser[INFO] http://localhost:6191/46566/bundles/core/core.entry.js 7:97457 "Detected an unhandled Promise rejection.
[00:04:31]                               │      TypeError: Failed to fetch"
[00:04:31]                               │ERROR browser[SEVERE] http://localhost:6191/46566/bundles/core/core.entry.js 0:15101 
[00:04:31]                               │ debg ... sleep(501) end
[00:04:31]                               │ debg in navigateTo url = http://localhost:6191/app/visualize#/
[00:04:31]                               │ debg TestSubjects.click(visListingTitleLink-e-commerce-pie-chart)
[00:04:31]                               │ debg Find.clickByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:04:31]                               │ debg Find.findByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:04:52]                               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="visListingTitleLink-e-commerce-pie-chart"])
[00:04:52]                               │      Wait timed out after 20278ms
[00:04:52]                               │ debg Find.findByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:05:12]                               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="visListingTitleLink-e-commerce-pie-chart"])
[00:05:12]                               │      Wait timed out after 20289ms
[00:05:13]                               │ debg Find.findByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:05:33]                               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="visListingTitleLink-e-commerce-pie-chart"])
[00:05:33]                               │      Wait timed out after 20222ms
[00:05:34]                               │ debg Find.findByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:05:54]                               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="visListingTitleLink-e-commerce-pie-chart"])
[00:05:54]                               │      Wait timed out after 20300ms
[00:05:54]                               │ debg Find.findByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:06:15]                               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="visListingTitleLink-e-commerce-pie-chart"])
[00:06:15]                               │      Wait timed out after 20270ms
[00:06:15]                               │ debg Find.findByCssSelector('[data-test-subj="visListingTitleLink-e-commerce-pie-chart"]') with timeout=20000
[00:06:35]                               │ debg --- retry.try error: Waiting for element to be located By(css selector, [data-test-subj="visListingTitleLink-e-commerce-pie-chart"])
[00:06:35]                               │      Wait timed out after 20238ms
[00:06:36]                               │ info Taking screenshot "/dev/shm/workspace/parallel/9/kibana/x-pack/test/functional/screenshots/failure/Reporting Functional Tests with Deprecated Security configuration enabled Security with _reporting_user_ built-in role Visualize Editor_ Generate Screenshot does allow user with reporting_user role.png"
[00:06:36]                               │ info Current URL is: http://localhost:6191/app/visualize#/
[00:06:36]                               │ info Saving page source to: /dev/shm/workspace/parallel/9/kibana/x-pack/test/functional/failure_debug/html/Reporting Functional Tests with Deprecated Security configuration enabled Security with _reporting_user_ built-in role Visualize Editor_ Generate Screenshot does allow user with reporting_user role.html
[00:06:36]                               └- ✖ fail: Reporting Functional Tests with Deprecated Security configuration enabled Security with `reporting_user` built-in role Visualize Editor: Generate Screenshot does allow user with reporting_user role
[00:06:36]                               │      Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="visListingTitleLink-e-commerce-pie-chart"])
[00:06:36]                               │ Wait timed out after 20238ms
[00:06:36]                               │     at /dev/shm/workspace/parallel/9/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
[00:06:36]                               │     at runMicrotasks (<anonymous>)
[00:06:36]                               │     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[00:06:36]                               │       at onFailure (/dev/shm/workspace/parallel/9/kibana/test/common/services/retry/retry_for_success.ts:17:9)
[00:06:36]                               │       at retryForSuccess (/dev/shm/workspace/parallel/9/kibana/test/common/services/retry/retry_for_success.ts:57:13)
[00:06:36]                               │       at RetryService.try (/dev/shm/workspace/parallel/9/kibana/test/common/services/retry/retry.ts:31:12)
[00:06:36]                               │       at Proxy.clickByCssSelector (/dev/shm/workspace/parallel/9/kibana/test/functional/services/common/find.ts:360:5)
[00:06:36]                               │       at TestSubjects.click (/dev/shm/workspace/parallel/9/kibana/test/functional/services/common/test_subjects.ts:105:5)
[00:06:36]                               │       at VisualizePageObject.openSavedVisualization (/dev/shm/workspace/parallel/9/kibana/test/functional/page_objects/visualize_page.ts:318:5)
[00:06:36]                               │       at Object.openSavedVisualization (test/reporting_functional/services/scenarios.ts:56:5)
[00:06:36]                               │       at Context.<anonymous> (test/reporting_functional/reporting_and_deprecated_security/security_roles_privileges.ts:104:9)
[00:06:36]                               │       at Object.apply (/dev/shm/workspace/parallel/9/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)
[00:06:36]                               │ 
[00:06:36]                               │ 

Stack Trace

Error: retry.try timeout: TimeoutError: Waiting for element to be located By(css selector, [data-test-subj="visListingTitleLink-e-commerce-pie-chart"])
Wait timed out after 20238ms
    at /dev/shm/workspace/parallel/9/kibana/node_modules/selenium-webdriver/lib/webdriver.js:842:17
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at onFailure (/dev/shm/workspace/parallel/9/kibana/test/common/services/retry/retry_for_success.ts:17:9)
    at retryForSuccess (/dev/shm/workspace/parallel/9/kibana/test/common/services/retry/retry_for_success.ts:57:13)
    at RetryService.try (/dev/shm/workspace/parallel/9/kibana/test/common/services/retry/retry.ts:31:12)
    at Proxy.clickByCssSelector (/dev/shm/workspace/parallel/9/kibana/test/functional/services/common/find.ts:360:5)
    at TestSubjects.click (/dev/shm/workspace/parallel/9/kibana/test/functional/services/common/test_subjects.ts:105:5)
    at VisualizePageObject.openSavedVisualization (/dev/shm/workspace/parallel/9/kibana/test/functional/page_objects/visualize_page.ts:318:5)
    at Object.openSavedVisualization (test/reporting_functional/services/scenarios.ts:56:5)
    at Context.<anonymous> (test/reporting_functional/reporting_and_deprecated_security/security_roles_privileges.ts:104:9)
    at Object.apply (/dev/shm/workspace/parallel/9/kibana/node_modules/@kbn/test/target_node/functional_test_runner/lib/mocha/wrap_function.js:87:16)

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 338 340 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 337.0KB 339.5KB +2.4KB

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @shahzad31

Copy link
Contributor

@dominiqueclarke dominiqueclarke left a comment

Choose a reason for hiding this comment

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

LGTM but one point in the AC is not implemented
There should be a link from cases back into exploratory view that loads the given chart in exploratory view
After discussing with Shahzad, this is not currently able to be implemented. This criteria should be moved to another ticket to keep track.

@shahzad31 shahzad31 added the auto-backport Deprecated - use backport:version if exact versions are needed label Sep 30, 2021
@shahzad31 shahzad31 merged commit bbf3d4b into elastic:master Sep 30, 2021
@shahzad31 shahzad31 deleted the add-to-case branch September 30, 2021 09:30
kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Sep 30, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.x

This backport PR will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request Sep 30, 2021
@timroes timroes changed the title [Exploratory View] Add to case button [Exploratory View] Adds "Add to case" button Oct 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:feature Makes this part of the condensed release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability v7.16.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Exploratory View] Add to Case
6 participants