Updated Product attributes placeholder to e.g. length or weight (#51379)

* Updated Product attributes placeholder to e.g. length or weight

* Added Changelog

* Add changefile(s) from automation for the following project(s): woocommerce

* Delete changelog/51134-product-attribute-placeholder-update

* Add changefile(s) from automation for the following project(s): woocommerce

* Revise changelog.

* Add changefile(s) from automation for the following project(s): woocommerce

* Satisfy linter.

* Increase exactitude to reduce ambiguity levels.

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Barry Hughes <3594411+barryhughes@users.noreply.github.com>
This commit is contained in:
Narendra Sishodiya 2024-09-18 04:29:22 +05:30 committed by GitHub
parent 5fe53a2e3f
commit c2fa5eeff5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 5 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Comment: Changed Product attributes placeholder to e.g. length or weight

View File

@ -20,7 +20,7 @@ if ( ! defined( 'ABSPATH' ) ) {
<strong><?php echo esc_html( wc_attribute_label( $attribute->get_name() ) ); ?></strong> <strong><?php echo esc_html( wc_attribute_label( $attribute->get_name() ) ); ?></strong>
<input type="hidden" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" /> <input type="hidden" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" />
<?php else : ?> <?php else : ?>
<input type="text" class="attribute_name" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" placeholder="<?php esc_attr_e( 'f.e. size or color', 'woocommerce' ); ?>" /> <input type="text" class="attribute_name" name="attribute_names[<?php echo esc_attr( $i ); ?>]" value="<?php echo esc_attr( $attribute->get_name() ); ?>" placeholder="<?php esc_attr_e( 'e.g. length or weight', 'woocommerce' ); ?>" />
<?php endif; ?> <?php endif; ?>
<input type="hidden" name="attribute_position[<?php echo esc_attr( $i ); ?>]" class="attribute_position" value="<?php echo esc_attr( $attribute->get_position() ); ?>" /> <input type="hidden" name="attribute_position[<?php echo esc_attr( $i ); ?>]" class="attribute_position" value="<?php echo esc_attr( $attribute->get_position() ); ?>" />
</td> </td>

View File

@ -112,7 +112,7 @@ for ( const productType of Object.keys( productData ) ) {
.getByRole( 'link', { name: 'Attributes' } ) .getByRole( 'link', { name: 'Attributes' } )
.click(); .click();
await page await page
.getByPlaceholder( 'f.e. size or color' ) .getByPlaceholder( 'e.g. length or weight' )
.fill( attributeName ); .fill( attributeName );
await page await page
.getByPlaceholder( 'Enter some descriptive text.' ) .getByPlaceholder( 'Enter some descriptive text.' )
@ -183,7 +183,7 @@ for ( const productType of Object.keys( productData ) ) {
.getByPlaceholder( '0' ) .getByPlaceholder( '0' )
.fill( productData[ productType ].shipping.weight ); .fill( productData[ productType ].shipping.weight );
await page await page
.getByPlaceholder( 'Length' ) .getByPlaceholder( 'Length', { exact: true } )
.fill( productData[ productType ].shipping.length ); .fill( productData[ productType ].shipping.length );
await page await page
.getByPlaceholder( 'Width' ) .getByPlaceholder( 'Width' )

View File

@ -39,8 +39,9 @@ test.describe( 'Add product attributes', { tag: '@gutenberg' }, () => {
} ); } );
test( 'can add custom product attributes', async ( { page } ) => { test( 'can add custom product attributes', async ( { page } ) => {
const textbox_attributeName = const textbox_attributeName = page.getByPlaceholder(
page.getByPlaceholder( 'f.e. size or color' ); 'e.g. length or weight'
);
const textbox_attributeValues = page.getByPlaceholder( const textbox_attributeValues = page.getByPlaceholder(
'Enter options for customers to choose from' 'Enter options for customers to choose from'
); );