1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
Feature: Header and footer behaviors
In order to control the appearance of page headers and footers
As a developer using python-docx
I need properties and methods on _Header and _Footer objects
Scenario Outline: _Header.is_linked_to_previous getter
Given a _Header object <with-or-no> header definition as header
Then header.is_linked_to_previous is <value>
Examples: _Header.is_linked_to_previous states
| with-or-no | value |
| with a | False |
| with no | True |
Scenario Outline: _Header.is_linked_to_previous setter
Given a _Header object <with-or-no> header definition as header
When I assign <value> to header.is_linked_to_previous
Then header.is_linked_to_previous is <value>
Examples: _Header.is_linked_to_previous state changes
| with-or-no | value |
| with a | True |
| with no | False |
| with a | False |
| with no | True |
Scenario: _Header inherits content
Given a _Header object with a header definition as header
And the next _Header object with no header definition as header_2
Then header_2.paragraphs[0].text == header.paragraphs[0].text
And header_2.is_linked_to_previous is True
Scenario: _Header text accepts style assignment
Given a _Header object with a header definition as header
When I assign "Normal" to header.paragraphs[0].style
Then header.paragraphs[0].style.name == "Normal"
Scenario Outline: _Footer.is_linked_to_previous getter
Given a _Footer object <with-or-no> footer definition as footer
Then footer.is_linked_to_previous is <value>
Examples: _Footer.is_linked_to_previous states
| with-or-no | value |
| with a | False |
| with no | True |
Scenario Outline: _Footer.is_linked_to_previous setter
Given a _Footer object <with-or-no> footer definition as footer
When I assign <value> to footer.is_linked_to_previous
Then footer.is_linked_to_previous is <value>
Examples: _Footer.is_linked_to_previous state changes
| with-or-no | value |
| with a | True |
| with no | False |
| with a | False |
| with no | True |
Scenario: _Footer inherits content
Given a _Footer object with a footer definition as footer
And the next _Footer object with no footer definition as footer_2
Then footer_2.paragraphs[0].text == footer.paragraphs[0].text
And footer_2.is_linked_to_previous is True
Scenario: _Footer text accepts style assignment
Given a _Footer object with a footer definition as footer
When I assign "Normal" to footer.paragraphs[0].style
Then footer.paragraphs[0].style.name == "Normal"
|