import time

import pytest

from page.createChapterLogic import CreateChapterPage
from page.delChapterPage import DelChapter
from page.loginPage import LoginPage


class TestChapter:
    def test_chapter(self,driver):
        # 登陆
        l = LoginPage(driver)
        l.login("15574113907", "123456")
        # 新建管理
        time.sleep(3)
        c=CreateChapterPage(driver)
        bookname=c.create_Chapter()
        time.sleep(3)
        # 删除管理  删除新建的管理
        d=DelChapter(driver)
        name_list=d.del_chapter()
        time.sleep(3)
        assert  bookname not in name_list

if __name__ == '__main__':
    pytest.main(['-sv',__file__])

# 有问题 1 没有问题2
