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

Add code examples to Page Component Objects (EN) #1387

Merged
merged 4 commits into from
May 18, 2023

Conversation

kathyrollo
Copy link
Contributor

@kathyrollo kathyrollo commented May 18, 2023

This PR adds much needed code examples to the Page Component Object section for the English translation.

Description

Relevant code is written in Java to complement the Page Object section, which also includes HTML structure, page object, page component object, and test methods to illustrate usage.

There are additional text written apart from the code. As the contributor is not a native of the other translations, the contribution is first made to the most used translation of the documentation.

Motivation and Context

  • While page components have been the intention of the Page Object Model from the start, it became lost in translation due to naming as noted by Martin Fowler in 2013.
  • No examples exist for "panel objects" (as M.F. first coined it), later known as "page components", on reputable or official sources for years.
  • No examples exist using JDK8+ features such as streams and lambdas, which make pages and components much simpler in implementation to complement Selenium 4.x.

Types of changes

  • Change to the site (I have double-checked the Netlify deployment, and my changes look good)
  • Code example added (and I also added the example to all translated languages)
  • Improved translation
  • Added new translation (and I also added a notice to each document missing translation)

Checklist

  • I have read the contributing document.
  • I have used hugo to render the site/docs locally and I am sure it works.

@netlify
Copy link

netlify bot commented May 18, 2023

Deploy Preview for selenium-dev ready!

Name Link
🔨 Latest commit 97fa333
🔍 Latest deploy log https://app.netlify.com/sites/selenium-dev/deploys/646616673f4cc4000824ce9a
😎 Deploy Preview https://deploy-preview-1387--selenium-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you for this PR!

Seems the other page_object_models.*.md are completely out of sync regarding the translation, could you please replace the content completely on that page?

Thanks!

@kathyrollo
Copy link
Contributor Author

Dear @diemol ,

Thank you for your review. 😄

I can add the code part, but unfortunately cannot translate the English text I added in between the paragraphs of the section. Google translate may have undesired results as I don't speak ja/pt-br/zh-cn and they also have native characters. 😅

Would you be happy for me to just put the code examples at the bottom of each non-English page?

@diemol
Copy link
Member

diemol commented May 18, 2023

You do not need to translate, I meant to replace the whole content page with the English version as somehow they are not reflecting the same content.

@kathyrollo
Copy link
Contributor Author

Hi @diemol , sorry a bit lost. 😅

Are you saying the English translation is not reflecting the changes? So far, I can only view the changes in netlify - https://deploy-preview-1387--selenium-dev.netlify.app/documentation/test_practices/encouraged/page_object_models/

@diemol
Copy link
Member

diemol commented May 18, 2023

No, no.

The idea is to have the same content from the page in English on the other pages. Which means, copy the content you have in English, and replace the whole content in the other languages. Because, over time, it seems we forgot to update the other languages and the English content evolved on its own.

@kathyrollo
Copy link
Contributor Author

Hi @diemol , from what I'm reading, it looks like we want to change all the other pages to English. If not, would you be able to provide an example for say page_object_models.ja.md? Happy to do the rest. 😄

@diemol
Copy link
Member

diemol commented May 18, 2023

Yes, all pages to English. Thanks.

@kathyrollo
Copy link
Contributor Author

Hi @diemol , I've copied the English content to the other pages as requested. Kept the titles native. Let me know if that suffices. Thanks!

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you!

@diemol diemol merged commit b9d1956 into SeleniumHQ:trunk May 18, 2023
selenium-ci added a commit that referenced this pull request May 18, 2023
* Add code examples to Page Component Objects (EN)

* Update closing text

* All relevant pages for page_object_models.*.md to English

---------

Co-authored-by: Diego Molina <[email protected]>

[deploy site] b9d1956
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants