|
@@ -30,39 +30,40 @@ class ProjectServiceHooksTest(AcceptanceTestCase):
|
|
|
self.new_hook_path = '/settings/{}/{}/hooks/new/'.format(self.org.slug, self.project.slug)
|
|
|
|
|
|
def test_simple(self):
|
|
|
- self.browser.get(self.list_hooks_path)
|
|
|
- self.browser.wait_until_not('.loading-indicator')
|
|
|
- self.browser.wait_until('.ref-project-service-hooks')
|
|
|
- self.browser.snapshot('project settings - service hooks - empty list')
|
|
|
- # click "New"
|
|
|
- self.browser.click('[data-test-id="new-service-hook"]')
|
|
|
+ with self.feature('projects:servicehooks'):
|
|
|
+ self.browser.get(self.list_hooks_path)
|
|
|
+ self.browser.wait_until_not('.loading-indicator')
|
|
|
+ self.browser.wait_until('.ref-project-service-hooks')
|
|
|
+ self.browser.snapshot('project settings - service hooks - empty list')
|
|
|
+ # click "New"
|
|
|
+ self.browser.click('[data-test-id="new-service-hook"]')
|
|
|
|
|
|
- self.browser.wait_until_not('.loading-indicator')
|
|
|
- assert self.browser.current_url == '{}{}'.format(
|
|
|
- self.browser.live_server_url,
|
|
|
- self.new_hook_path,
|
|
|
- )
|
|
|
- self.browser.snapshot('project settings - service hooks - create')
|
|
|
- self.browser.element('input[name="url"]').send_keys('https://example.com/hook')
|
|
|
- # click "Save Changes"
|
|
|
- self.browser.click('.ref-project-create-service-hook [data-test-id="form-submit"]')
|
|
|
+ self.browser.wait_until_not('.loading-indicator')
|
|
|
+ assert self.browser.current_url == '{}{}'.format(
|
|
|
+ self.browser.live_server_url,
|
|
|
+ self.new_hook_path,
|
|
|
+ )
|
|
|
+ self.browser.snapshot('project settings - service hooks - create')
|
|
|
+ self.browser.element('input[name="url"]').send_keys('https://example.com/hook')
|
|
|
+ # click "Save Changes"
|
|
|
+ self.browser.click('.ref-project-create-service-hook [data-test-id="form-submit"]')
|
|
|
|
|
|
- self.browser.wait_until_not('.loading-indicator')
|
|
|
- assert self.browser.current_url == '{}{}'.format(
|
|
|
- self.browser.live_server_url,
|
|
|
- self.list_hooks_path,
|
|
|
- )
|
|
|
- self.browser.snapshot('project settings - service hooks - list with entries')
|
|
|
+ self.browser.wait_until_not('.loading-indicator')
|
|
|
+ assert self.browser.current_url == '{}{}'.format(
|
|
|
+ self.browser.live_server_url,
|
|
|
+ self.list_hooks_path,
|
|
|
+ )
|
|
|
+ self.browser.snapshot('project settings - service hooks - list with entries')
|
|
|
|
|
|
- hook = ServiceHook.objects.get(project_id=self.project.id)
|
|
|
- assert hook.url == 'https://example.com/hook'
|
|
|
- assert not hook.events
|
|
|
+ hook = ServiceHook.objects.get(project_id=self.project.id)
|
|
|
+ assert hook.url == 'https://example.com/hook'
|
|
|
+ assert not hook.events
|
|
|
|
|
|
- # hopefully click the first service hook
|
|
|
- self.browser.click('.ref-project-service-hooks label a')
|
|
|
- self.browser.wait_until_not('.loading-indicator')
|
|
|
- assert self.browser.current_url == '{}{}'.format(
|
|
|
- self.browser.live_server_url,
|
|
|
- '/settings/{}/{}/hooks/{}/'.format(self.org.slug, self.project.slug, hook.guid),
|
|
|
- )
|
|
|
- self.browser.snapshot('project settings - service hooks - details')
|
|
|
+ # hopefully click the first service hook
|
|
|
+ self.browser.click('.ref-project-service-hooks label a')
|
|
|
+ self.browser.wait_until_not('.loading-indicator')
|
|
|
+ assert self.browser.current_url == '{}{}'.format(
|
|
|
+ self.browser.live_server_url,
|
|
|
+ '/settings/{}/{}/hooks/{}/'.format(self.org.slug, self.project.slug, hook.guid),
|
|
|
+ )
|
|
|
+ self.browser.snapshot('project settings - service hooks - details')
|