Skip to content

Commit

Permalink
WCM-316: add browser test for title-overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinnaj94 committed Sep 16, 2024
1 parent d3429ac commit 3b3017f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions core/src/zeit/content/volume/browser/tests/test_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,24 @@ def test_only_one_cover_add_form_is_visible_at_the_time(self):
s.select('id=choose-cover', 'label=Zeit Magazin')
s.assertVisible('css=.fieldname-cover_ZMLB_portrait')
s.assertNotVisible('css=.fieldname-cover_ZEI_portrait')

def test_saves_title_for_each_cover(self):
s = self.selenium
volume = self.repository['2015']['01']['ausgabe']
title_overrides = volume.xml.makeelement('title-overrides')
text_zei = volume.xml.makeelement('title', {'product_id': 'ZEI'})
text_zei.text = 'Budgies are cool'
text_zmlb = volume.xml.makeelement('title', {'product_id': 'ZMLB'})
text_zmlb.text = 'Kingfishers are eating fish'
title_overrides.append(text_zei)
title_overrides.append(text_zmlb)
volume.xml.append(title_overrides)
self.repository['2015']['01']['ausgabe'] = volume
self.open('/repository/2015/01/ausgabe/@@checkout')
s.waitForElementPresent('css=#choose-cover')
# Set title of Die Zeit
s.select('id=choose-cover', 'label=Die Zeit')
s.assertValue('id=form.title_ZEI', 'Budgies are cool')
# Set title for Zeit Magazin
s.select('id=choose-cover', 'label=Zeit Magazin')
s.assertValue('id=form.title_ZMLB', 'Kingfishers are eating fish')

0 comments on commit 3b3017f

Please sign in to comment.