1
0
mirror of https://github.com/zedeus/nitter.git synced 2025-12-06 03:55:36 -05:00

Improve test base

This commit is contained in:
Zed
2019-06-29 00:41:57 +02:00
parent ee1d6f7cf0
commit a5676e1c2c
2 changed files with 8 additions and 6 deletions

View File

@@ -3,19 +3,21 @@ from seleniumbase import BaseCase
class Tweet(object):
def __init__(self, tweet=''):
namerow = tweet + 'div.media-heading > div > .fullname-and-username > '
namerow = tweet + 'div.media-heading '
self.fullname = namerow + '.fullname'
self.username = namerow + '.username'
self.date = tweet + 'div.media-heading > div > .heading-right'
self.text = tweet + '.status-content-wrapper > .status-content.media-body'
self.date = tweet + 'div.media-heading .heading-right'
self.text = tweet + '.status-content-wrapper .status-content.media-body'
self.retweet = tweet = '.retweet'
class Profile(object):
fullname = '.profile-card-fullname'
username = '.profile-card-username'
bio = '.profile-bio'
protected = '.protected-icon'
verified = '.verified-icon'
banner = '.profile-banner'
bio = '.profile-bio'
class BaseTestCase(BaseCase):
@@ -35,4 +37,4 @@ class BaseTestCase(BaseCase):
def get_timeline_tweet(num=1):
return Tweet(f'#tweets > div:nth-child({num}) > div > div ')
return Tweet(f'#tweets > div:nth-child({num}) ')