Fakultas Ilmu Komputer UI

Commit c249473f authored by Agas Yanpratama's avatar Agas Yanpratama 💬
Browse files

Add Func Test to delete list item

parent 5e1f936d
Pipeline #28403 failed with stages
in 31 minutes and 37 seconds
1. URL Gitlab:
https://gitlab.cs.ui.ac.id/pmpl/practice-collection/2019/1606918396-practice
2. Branch yang digunakan:
takehome-UAS
https://gitlab.cs.ui.ac.id/pmpl/practice-collection/2019/1606918396-practice/tree/takehome-UAS
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from .base import FunctionalTest
class DeleteListItemTest(FunctionalTest):
def test_can_delete_todo_list_item(self):
self.browser.get(self.live_server_url)
# User mengisi item pertama
self.browser.find_element_by_id('id_new_item').send_keys('Beli kfc')
self.browser.find_element_by_id('id_new_item').send_keys(Keys.ENTER)
self.wait_for_row_in_list_table('1: Beli kfc')
# User mengisi item kedua
self.browser.find_element_by_id('id_new_item').send_keys('Minum aqua')
self.browser.find_element_by_id('id_new_item').send_keys(Keys.ENTER)
self.wait_for_row_in_list_table('2: Minum aqua')
# Karena user sudah beli mcd maka user tidak jadi beli kfc dan ingin dihapus
delKFC = self.browser.find_elements_by_id('del-button-1')
delKFC.click()
# Mengecek kfc sudah tidak ada di to do list
page_text = self.browser.find_element_by_tag_name('body').text
self.assertNotIn('Beli kfc', page_text)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment