WordPress.org

Make WordPress Core

Opened 8 days ago

Last modified 17 minutes ago

#54241 assigned enhancement

e2e tests for applications password feature

Reported by: justinahinon Owned by: hellofromTonya
Milestone: 5.9 Priority: normal
Severity: normal Version: trunk
Component: Build/Test Tools Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

This ticket is a sub ticket of #52895.


The applications password feature in WordPress Core is one new introduced feature in WordPress Core a few releases back.

This ticket aims to add e2e tests for this feature.

Change History (7)

This ticket was mentioned in PR #1746 on WordPress/wordpress-develop by JustinyAhin.


8 days ago

  • Keywords has-unit-tests added

Related Trac ticket: https://core.trac.wordpress.org/ticket/54241.


# Test scenarios

## Create a new application password

Given that a test user exists
When I go to Users > Profile, and I create a new application password
I see the new application password success message
And the application name appears in the app password table
And the application password information are present in the response of GET /wp/v2/users/<user_id>/application-passwords

## Create an application password with an existing name

Given that a test user exists
And has an existing application password
When I go to Users > Profile, and I create a new application password with the same name
I should receive an error message, and the new application password should not be created

## Revoke a single application password

Given that a test user exists
And has an existing application password
When I go to Users > Profile
And I click on the Revoke button
The application password should be revoked with a displayed success message
And the application password information should not be present in the response of GET /wp/v2/users/<user_id>/application-passwords

## Bulk revoke applications passwords

Given that a test user exists
And has two existing applications passwords
When I go to Users > Profile
And I click on the Revoke all application passwords button
Then all applications passwords should be removed with a displayed success message
And the applications passwords information should not be present in the response of GET /wp/v2/users/<user_id>/application-passwords

#2 @prbot
7 days ago

hellofromtonya commented on PR #1746:

@kevin940726 and @tellthemachines this PR is ready for your review. Once approved, I'll get it committed.

#3 @hellofromTonya
4 days ago

  • Keywords needs-testing removed
  • Owner set to hellofromTonya
  • Status changed from new to assigned

#4 @prbot
4 days ago

kevin940726 commented on PR #1746:

Just found out there's a console error warning in the test output:

https://github.com/WordPress/wordpress-develop/pull/1746/checks?check_run_id=3902891514#step:13:17

I don't think it's a big deal, but would be great if we could get rid of it somehow.

#5 @prbot
4 days ago

JustinyAhin commented on PR #1746:

Thanks for all the reviews @kevin940726. This is exactly the kind of feedback I was hoping :).

#6 @prbot
4 days ago

JustinyAhin commented on PR #1746:

Thanks for all the reviews @kevin940726. This is exactly the kind of feedback I was hoping :).

#7 @prbot
17 minutes ago

kevin940726 commented on PR #1746:

One more thing I noticed, I think we should follow the coding style guide in tests as well? Not sure why eslint isn't picking those up. Might worth to fix that too in another PR.

Note: See TracTickets for help on using tickets.