test(office): PowerPoint 视觉意图用例的初始文本框改为满宽
原来的文本框偏离页面中心,「标题居中」需要同时移动文本框。office 正文 不再写这条 python-pptx 细节,用户排除渲染时模型拿不到位置反馈,用例因此 不稳定。改为满宽文本框后,用例只验证段落对齐、颜色和文本框仍然居中。
This commit is contained in:
1 parent
d417b2a430
commit
9c093c0025
1 file changed
+1
-1
@@ -23,7 +23,7 @@ const formats = [
|
||||
notesTask: 'set the speaker notes of slide 1 to Revenue grew 50%. without changing the slide',
|
||||
verifyNotes: "from pptx import Presentation\np=Presentation('result.pptx'); s=p.slides[0]; assert s.has_notes_slide and s.notes_slide.notes_text_frame.text.strip() == 'Revenue grew 50%.'; assert s.shapes[0].text == 'Quarterly revenue'",
|
||||
format: 'pptx', task: 'center the title on slide 1 and set its font color to #1F4E79',
|
||||
seed: "from pptx import Presentation\nfrom pptx.util import Inches\np=Presentation(); s=p.slides.add_slide(p.slide_layouts[6]); s.shapes.add_textbox(Inches(1),Inches(1),Inches(6),Inches(1)).text='Quarterly revenue'; p.save('input.pptx')",
|
||||
seed: "from pptx import Presentation\nfrom pptx.util import Inches\np=Presentation(); s=p.slides.add_slide(p.slide_layouts[6]); s.shapes.add_textbox(0,Inches(1),p.slide_width,Inches(1)).text='Quarterly revenue'; p.save('input.pptx')",
|
||||
verify: "from pptx import Presentation\nfrom pptx.enum.text import PP_ALIGN\np=Presentation('result.pptx'); title=p.slides[0].shapes[0]; r=title.text_frame.paragraphs[0]; assert r.alignment == PP_ALIGN.CENTER; assert abs(2*title.left+title.width-p.slide_width) <= 1; assert str(r.runs[0].font.color.rgb).upper() == '1F4E79'",
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user