diff --git a/stock_monitoring/tests/test_selenium.py b/stock_monitoring/tests/test_selenium.py index 5152ef568d2541823b44b06a0d5c5d92307b3f43..cb947ebd2ac83bb4c79f29b101b1132feb462547 100644 --- a/stock_monitoring/tests/test_selenium.py +++ b/stock_monitoring/tests/test_selenium.py @@ -1,5 +1,5 @@ from django.test import LiveServerTestCase -from stock_monitoring.models import Barang, Pergerakan +from stock_monitoring.models import Obat from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.keys import Keys @@ -13,8 +13,8 @@ class SeleniumShowAllBarangTestCase(LiveServerTestCase): self.driver.implicitly_wait(10) # Implicit wait to handle dynamic elements # Create some Barang objects for testing pagination - Barang.objects.create(barang_id="a", barang_nama='Product A', barang_qty=100, barang_expired='2024-06-30', barang_kondisi='New', barang_jenis='Type A', barang_unit='Unit A', barang_gambar='ristek.link/panadol') - Barang.objects.create(barang_id="b", barang_nama='Product B', barang_qty=50, barang_expired='2024-08-15', barang_kondisi='Used', barang_jenis='Type B', barang_unit='Unit B', barang_gambar='ristek.link/panadol') + Obat.objects.create(barang_id="a", barang_nama='Product A', barang_qty=100, barang_expired='2024-06-30', barang_kondisi='New', barang_jenis='Type A', barang_unit='Unit A', barang_gambar='ristek.link/panadol') + Obat.objects.create(barang_id="b", barang_nama='Product B', barang_qty=50, barang_expired='2024-08-15', barang_kondisi='Used', barang_jenis='Type B', barang_unit='Unit B', barang_gambar='ristek.link/panadol') def test_show_all_barang_pagination(self): # Open the browser and navigate to the live server @@ -53,7 +53,7 @@ class SeleniumShowAllBarangTestCase(LiveServerTestCase): def test_show_all_barang_empty_object(self): # Positive Test # Delete all Barang objects to simulate an empty database - Barang.objects.all().delete() + Obat.objects.all().delete() # Make a request to the view self.driver.get(self.live_server_url + '/stock_monitoring/') @@ -90,7 +90,7 @@ class SeleniumShowDetailBarangTestCase(LiveServerTestCase): self.driver.implicitly_wait(10) # Implicit wait to handle dynamic elements # Create some Barang objects for testing - self.barang_1 = Barang.objects.create( + self.barang_1 = Obat.objects.create( barang_id="one", barang_nama='Barang 1', barang_qty=100, @@ -101,7 +101,7 @@ class SeleniumShowDetailBarangTestCase(LiveServerTestCase): barang_gambar='ristek.link/obat_1' ) - self.barang_2 = Barang.objects.create( + self.barang_2 = Obat.objects.create( barang_id="two", barang_nama='Barang 2', barang_qty=100,