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

[Flaky Test] shows a warning if user does not have permission to create navigation menus #37604

Closed
github-actions bot opened this issue Dec 23, 2021 · 6 comments · Fixed by #38025
Closed
Assignees
Labels
[Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Flaky Test Auto-generated flaky test report issue

Comments

@github-actions
Copy link

github-actions bot commented Dec 23, 2021

Flaky test detected. This is an auto-generated issue by GitHub Actions. Please do NOT edit this manually.

Test title

shows a warning if user does not have permission to create navigation menus

Test path

specs/editor/blocks/navigation.test.js

Errors

[2021-12-23T05:40:55.695Z] Test passed after 1 failed attempt on docs/36278-gen-theme-ref.
[2022-01-05T14:17:11.192Z] Test passed after 1 failed attempt on trunk.
[2022-01-13T08:15:44.893Z] Test passed after 1 failed attempt on add-context-i18n-light.
[2022-04-04T09:02:24.920Z] Test passed after 2 failed attempts on try/auto-select-first-nav-menu-if-solo.
[2022-07-19T12:01:31.684Z] Test passed after 1 failed attempt on add/author-nicename-template.
[2022-07-20T11:03:06.317Z] Test passed after 1 failed attempt on add/html-tokenizer-2.
[2022-07-26T07:36:35.735Z] Test passed after 1 failed attempt on fix/replace-clickable-divs-with-buttons.
  ● Navigation › Permission based restrictions › shows a warning if user does not have permission to create navigation menus

    expect(jest.fn()).toHaveErrored(expected)

    Expected mock function to be called.

      1336 | 			// * /wp/v2/settings?_locale=user
      1337 | 			// * /wp/v2/templates?context=edit&post_type=post&per_page=100&_locale=user
    > 1338 | 			expect( console ).toHaveErrored();
           | 			                  ^
      1339 | 		} );
      1340 | 	} );
      1341 |

      at Object.<anonymous> (specs/editor/blocks/navigation.test.js:1338:22)
          at runMicrotasks (<anonymous>)

@github-actions github-actions bot added the [Type] Flaky Test Auto-generated flaky test report issue label Dec 23, 2021
@getdave getdave self-assigned this Jan 17, 2022
@getdave
Copy link
Contributor

getdave commented Jan 17, 2022

Ok this one appears to be because the user is still logged in as admin at the point of the assertion. This was working at point of merge and now its regressed.

Here's a screenshot from the artifacts

shows a warning if user does not have permission to create navigation menus 2022-01-17T10-34-32

@getdave
Copy link
Contributor

getdave commented Apr 4, 2022

Reopened by my random branch. Closing again as I know why this failed.

@getdave getdave closed this as completed Apr 4, 2022
@github-actions github-actions bot reopened this Jul 19, 2022
@getdave
Copy link
Contributor

getdave commented Jul 20, 2022

This could be because the endpoints no longer 403 for lower perm users:

// Expect a console 403 for requests to:
// * /wp/v2/settings?_locale=user
// * /wp/v2/templates?context=edit&post_type=post&per_page=100&_locale=user
expect( console ).toHaveErrored();

@talldan
Copy link
Contributor

talldan commented Jul 25, 2022

I've personally seen this fail quite regularly with this error:

TimeoutError: waiting for XPath `//*[contains(@class, 'components-snackbar__content')][ text()="You do not have permission to create Navigation Menus." ]` failed: timeout 30000ms exceeded

examples:

The artifact still shows the logged in user as admin (in the top-right corner it should say 'Howdy, contributor!'), so I think that's where the issue lies:
shows a warning if user does not have permission to create navigation menus 2022-07-22T19-01-01

@talldan
Copy link
Contributor

talldan commented Jul 26, 2022

I'm going to skip this test (#42693).

BTW, I had started migrating the nav block tests to playwright a couple of months ago, but haven't had time to finish this effort. I've pushed a draft PR - #42695.

I actually got stuck on migrating the permissions tests because I hadn't been able to figure out a way to log in as a different user in playwright tests.

@github-actions
Copy link
Author

This issue has gone 30 days without any activity.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. [Type] Flaky Test Auto-generated flaky test report issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants