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

#682 production tests #688

Merged
merged 10 commits into from
Jan 16, 2019
Merged

#682 production tests #688

merged 10 commits into from
Jan 16, 2019

Conversation

ArtemijRodionov
Copy link
Contributor

Closes #682 #323

@ArtemijRodionov ArtemijRodionov self-assigned this Jan 15, 2019
Copy link
Contributor

@duker33 duker33 left a comment

Choose a reason for hiding this comment

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

some naiming, minor arch and tasks estimates

It is based on `pages` and `elements`.

The page object should encapsulate the mechanics required
to find and manipulate the data and combines elements to reache it.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
to find and manipulate the data and combines elements to reache it.
to find and manipulate the data and combines elements to reach it.



class ProductCard:
""""Represent a product card of category page."""
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
""""Represent a product card of category page."""
""""Represent a product card from category page."""

class ProductCard:
""""Represent a product card of category page."""

def __init__(self, driver, card_number):
Copy link
Contributor

Choose a reason for hiding this comment

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

it'll be good to provide doc for card_number: Order number at category page's card list

self.driver.wait.until(EC.visibility_of_element_located(By.XPATH, xpath))

def add_to_cart(self):
self._get_element(self.xpath).click()
Copy link
Contributor

Choose a reason for hiding this comment

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

and ctor we have button_xpath, but here is xpath

self.button_xpath = f'//*[@id="products-wrapper"]/div[{card_number}]/div[2]/div[5]/button'

def _get_element(self, xpath):
self.driver.wait.until(EC.visibility_of_element_located(By.XPATH, xpath))
Copy link
Contributor

Choose a reason for hiding this comment

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

we are not needed to pass xpath as the arg, because we already have xpath as field of self

Copy link
Contributor

Choose a reason for hiding this comment

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

we should pass By.XPATH, xpath pair as tuple as i know. Maybe it's not necessary, but we usually do like this

self.slug = slug

@property
def address(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

before this moment we used path for reversed part of url without domain. Why address now?
Maybe we'll leave path?

OrderPage too


from pages.models import CustomPage

# @todo #682:60m Implement and reuse shopelectro.selenium.OrderPage for selenium tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

i suggest 120m for this task


def fill_contacts(self, contacts):
pass

Copy link
Contributor

Choose a reason for hiding this comment

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

we should choose payment type here too

self.driver = driver
self.address: str

def move_to(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

when we read page.move_to(), someone can think, that we are moving somewhere outside this page.
I suggest load or open as name

self.address: str

def move_to(self):
assert self.address, f"Set a page address to {self.__class__.__name__}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
assert self.address, f"Set a page address to {self.__class__.__name__}"
assert self.address, f'Set a page address to {self.__class__.__name__}'

@ArtemijRodionov ArtemijRodionov merged commit 9ef7b84 into master Jan 16, 2019
@ArtemijRodionov ArtemijRodionov deleted the 682-production-tests branch January 16, 2019 13:59
@duker33 duker33 added the Selenium pages feature label Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants