class ArtistPageTracksTableLocators: cell = "artist-table-cell-" position, starred, cover, track_name, album, release_date, streams, change, tooltip = \ "position", "starred", "cover", "track-name", "album", "release-date", "streams", "change", "tooltip" column_header_xpath = "//*[@id='{0}{1}']" column_cell_xpath = "//*[contains(@id, '{0}{1}-')]" TITLE = "//*[text()='Tracks']" FILTER_INPUT = "//*[@id='artist-filter-input']" # table TABLE_HEADER = "//*[@id='artist-table-header']" # table column headers COLUMN_POSITION = column_header_xpath.format(cell, position) COLUMN_STARRED = column_header_xpath.format(cell, starred) COLUMN_COVER = column_header_xpath.format(cell, cover) COLUMN_TRACK_NAME = column_header_xpath.format(cell, track_name) COLUMN_ALBUM = column_header_xpath.format(cell, album) COLUMN_RELEASE_DATE = column_header_xpath.format(cell, release_date) COLUMN_STREAMS = column_header_xpath.format(cell, streams) COLUMN_CHANGE = column_header_xpath.format(cell, change) # table column cells COLUMN_POSITION_CELL = column_cell_xpath.format(cell, position) COLUMN_STARRED_CELL = column_cell_xpath.format(cell, starred) COLUMN_COVER_CELL = column_cell_xpath.format(cell, cover) COLUMN_TRACK_NAME_CELL = column_cell_xpath.format(cell, track_name) COLUMN_TRACK_ISRC = "//*[@id='' and not(text()='BETA')]" COLUMN_TRACK_NAME_NAME = "//*[contains(@href, '/spotify/track/')]" COLUMN_ALBUM_CELL = column_cell_xpath.format(cell, album) COLUMN_RELEASE_DATE_CELL = column_cell_xpath.format(cell, release_date) COLUMN_STREAMS_CELL = column_cell_xpath.format(cell, streams) COLUMN_CHANGE_POSITION = "//span[contains(@id, '-trend-position-') and not(contains(@id, 'change'))]" COLUMN_CHANGE_PERCENTAGE = "//*[contains(@id, '-trend-percent-')]" # tooltips CURRENT_STREAMS_TOOLTIP = f"//*[@id='{cell}{streams}-{tooltip}']"