You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use Python's property construct on the attributes for is_page_element and is_alert_element within the BaseElement sub classes.
Reasoning
Properties let you set getters and setters on attributes. This promotes the idea of encapsulation and is generally considered good practice. In this specific case, I don't want developers to be able to change the value of is_page_element or is_alert_element. A PageElement is always a page element, no matter what, so the setter will hijack any attempts to change those values and simply return false when someone tries to set those values.
This particular issue is for a specific user who said they wanted to get started with open-source. Please don't pick up this issue unless you are Ujjwal.
Step-by-Step Guide
To make this contribution, please follow these steps:
Clone the Repository
The first thing you want to do is get this code onto your local computer. You can do this by running the following command:
$> git@github.com:erik-whiting/LuluTest.git
Note, the $> represents your terminal prompt, it is not actually part of the command you need to run
Make a new Branch
Now that you've cloned the code, you need to make a new branch. CD into the project with
$> cd LuluTest
and create a new branch. This will make all the work you do independent of the development branch until I merge it. Here's a good article about branches in git.
Let's call our branch add-properties-to-alert-element. To create and checkout this branch, run the following command:
Now that you've made a new branch, you can start making changes to the code. You will want to work on the AlertElement class. This class is defined in LuluTest/element/alert_element.py. You need to make changes that are nearly identical to the equivalent pull request for PageElement. Look at the files changed in that pull request and do almost the same thing to AlertElement.
Commit Your Changes
Once you're done with the code changes, it's time to commit the changes. You'll do this by running the following command:
$> git commit -am "Some commit message"
Make your commit message a broad statement about what you did. Something like "Add properties to AlertElement".
Push Branch and Create Pull Request
The next thing you have to do is submit your changes for review. This involves pushing your branch to the repository and then making a pull request out of it. To push the branch, run the following command:
Once the branch has been pushed, go to the repository's homepage (https://github.com/erik-whiting/LuluTest) and you should see a prompt with a green button that says "Create pull request." Press that button and follow along.
Await Review
Once you've made a pull-request, I will be alerted that someone wants to merge their work into the repository. I will look it over and if everything is good, I will merge it into the development branch and you will have officially made your first contribution, congratulations!
Usually, you will have to fix any failing automated tests or other PR checks but this repository is currently a little disorganized and its tests are failing for a bunch of unrelated reasons. I plan to fix that in the coming weeks but for now, just ignore the failing tests.
The text was updated successfully, but these errors were encountered:
Overview
I want to use Python's property construct on the attributes for
is_page_element
andis_alert_element
within theBaseElement
sub classes.Reasoning
Properties let you set getters and setters on attributes. This promotes the idea of encapsulation and is generally considered good practice. In this specific case, I don't want developers to be able to change the value of
is_page_element
oris_alert_element
. APageElement
is always a page element, no matter what, so the setter will hijack any attempts to change those values and simply return false when someone tries to set those values.This particular issue is for a specific user who said they wanted to get started with open-source. Please don't pick up this issue unless you are Ujjwal.
Step-by-Step Guide
To make this contribution, please follow these steps:
Clone the Repository
The first thing you want to do is get this code onto your local computer. You can do this by running the following command:
Note, the
$>
represents your terminal prompt, it is not actually part of the command you need to runMake a new Branch
Now that you've cloned the code, you need to make a new branch. CD into the project with
and create a new branch. This will make all the work you do independent of the
development
branch until I merge it. Here's a good article about branches in git.Let's call our branch
add-properties-to-alert-element
. To create and checkout this branch, run the following command:Make the Code Changes
Now that you've made a new branch, you can start making changes to the code. You will want to work on the
AlertElement
class. This class is defined inLuluTest/element/alert_element.py
. You need to make changes that are nearly identical to the equivalent pull request forPageElement
. Look at the files changed in that pull request and do almost the same thing toAlertElement
.Commit Your Changes
Once you're done with the code changes, it's time to commit the changes. You'll do this by running the following command:
Make your commit message a broad statement about what you did. Something like "Add properties to AlertElement".
Push Branch and Create Pull Request
The next thing you have to do is submit your changes for review. This involves pushing your branch to the repository and then making a pull request out of it. To push the branch, run the following command:
Once the branch has been pushed, go to the repository's homepage (https://github.com/erik-whiting/LuluTest) and you should see a prompt with a green button that says "Create pull request." Press that button and follow along.
Await Review
Once you've made a pull-request, I will be alerted that someone wants to merge their work into the repository. I will look it over and if everything is good, I will merge it into the
development
branch and you will have officially made your first contribution, congratulations!Usually, you will have to fix any failing automated tests or other PR checks but this repository is currently a little disorganized and its tests are failing for a bunch of unrelated reasons. I plan to fix that in the coming weeks but for now, just ignore the failing tests.
The text was updated successfully, but these errors were encountered: