Skip to content

Commit

Permalink
release: v8.2 (#1231)
Browse files Browse the repository at this point in the history
* skip: python via web

* skip: bug 63370

* fix: 70602

* bug: 71029

* fix: page size preset 63370

* fix: correct object types

* ref: add semver

* [update] 8.2 tests fix (#1230)

* tests fix

* tests fix

* ref: semver

---------

Co-authored-by: Olga Petrova <58073620+lemonowl@users.noreply.github.com>
  • Loading branch information
askonev and lemonowl authored Oct 17, 2024
1 parent 1f9c31f commit 7c68cf8
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ end
desc 'run parallel_rspec on builder in documentserver'
task :web do
ENV['BUILDER_PLATFORM'] = 'WEB'
sh 'bundle exec parallel_rspec spec'
sh 'bundle exec parallel_rspec --exclude-pattern "spec/python_wrapper/**" spec'
end

desc 'run only critical tests'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ builder.CreateFile("docx");
let oDocument = Api.GetDocument();
let oParagraph = oDocument.GetElement(0);
oParagraph.AddText("Paragraph with bookmark");
let oRange = oDocument.GetRange(0, 9);
let oRange = oDocument.GetRange(0, 10);
oRange.AddBookmark("Bookmark");

let oParagraph1 = Api.CreateParagraph();
Expand Down
19 changes: 11 additions & 8 deletions js/docx/sections/page_size_for_section.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
builder.CreateFile("docx");
var oDocument = Api.GetDocument();
oDocument.CreateNewHistoryPoint();
var oParagraph1, oFinalSection;
oParagraph = Api.CreateParagraph();
oDocument.Push(oParagraph);
oSection = oDocument.CreateSection(oParagraph);
oFinalSection = oDocument.GetFinalSection();
oFinalSection.SetPageSize(12240, 15840);
var oDocument = Api.GetDocument();
oDocument.CreateNewHistoryPoint();
var oParagraph, oFinalSection, oSection;
oFinalSection = oDocument.GetFinalSection();
oFinalSection.SetPageSize(11904.8, 16838); // 'A4'

oParagraph = Api.CreateParagraph();
oParagraph.AddText('section');
oDocument.Push(oParagraph);
oSection = oDocument.CreateSection(oParagraph);
oSection.SetPageSize(12240, 15840); // 'US Letter'
builder.SaveFile("docx", "page_size_for_section.docx");
builder.CloseFile();
2 changes: 1 addition & 1 deletion js/docx/smoke/api_document_content/to_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ builder.CreateFile("docx");
// Add Hyperlink
oParagraph = oDocContent.GetElement(0);
oParagraph.AddText('Hyperlink');
var oRange = oParagraph.GetRange(0, 8);
var oRange = oParagraph.GetRange(0, 10);
oRange.AddHyperlink('https://api.onlyoffice.com')
// Add BlockLvlSdt
var oBlockLvlSdt = Api.CreateBlockLvlSdt();
Expand Down
2 changes: 1 addition & 1 deletion js/docx/smoke/api_range/to_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ builder.CreateFile("docx");
var oDocument = Api.GetDocument();
var oParagraph = oDocument.GetElement(0);
oParagraph.AddText("ONLYOFFICE Document Builder");
var oRange = Api.CreateRange(oParagraph, 0, 10);
var oRange = Api.CreateRange(oParagraph, 0, 11);
var json = oRange.ToJSON(true, true);
GlobalVariable["JSON"] = json;
builder.CloseFile();
Expand Down
1 change: 1 addition & 0 deletions spec/docx/conversion/docx_conversion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
end

it 'Conversion | Docx to Pdf', :critical do
skip 'https://bugzilla.onlyoffice.com/show_bug.cgi?id=71025' if builder.semver >= Semantic::Version.new('8.2.0')
output_file = builder.build_file('js/conversion/docx/docx_to_pdf.js')
expect(builder).not_to be_file_empty(output_file)
end
Expand Down
2 changes: 2 additions & 0 deletions spec/docx/negative/api_range_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
let(:style) { OoxmlParser::FontStyle.new }
let(:file_path) { 'js/docx/smoke/api_range/get_range_with_params.js' }

before { skip('Fix after moving to sending the script as a static file') }

it 'Check method with wrong parameters 0, -1' do
docx = builder.build_and_parse(file_path, start_pos: 0, end_pos: -1)
expect(docx.elements.size).to eq(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@

it 'Cross-reference to bookmarks' do
docx = builder.build_and_parse('js/docx/paragraph/cross_reference/add_bookmark_cross_ref.js')
expect(docx.elements[1].nonempty_runs[1].text).to eq('Paragraph')
# TODO: 'check after release'
if builder.semver >= Semantic::Version.new('8.2.0')
expect(docx.elements[1].nonempty_runs[1].text).to eq('Paragraph')
else
expect(docx.elements[1].nonempty_runs[1].text).to eq('Paragraph ')
end
expect(docx.elements[1].runs[2].instruction_text.value).to eq(' REF Bookmark \\h')
# TODO: bug 'https://bugzilla.onlyoffice.com/show_bug.cgi?id=58898'
# expect(docx.elements[2].nonempty_runs[1].text).to eq('1')
Expand Down
4 changes: 2 additions & 2 deletions spec/docx/sections/add_section_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

it 'Page size for Section' do
docx = builder.build_and_parse('js/docx/sections/page_size_for_section.js')
expect(docx.page_properties.size.name).to eq('US Letter')
expect(docx.elements[1].sector_properties.size.name).to eq('A4')
expect(docx.page_properties.size.name).to eq('A4')
expect(docx.elements[1].sector_properties.size.name).to eq('US Letter')
end
end
6 changes: 5 additions & 1 deletion spec/docx/smoke/api_document_content_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,11 @@
expect(docx.elements[2].properties.table_style.name).to eq('CustomTableStyle')
json = JSON.parse(docx.elements[5].nonempty_runs.first.text)
expect(json['type']).to eq('docContent')
expect(json['content'][0]['content'][2]['type']).to eq('hyperlink')
if builder.semver >= Semantic::Version.new('8.2.0')
expect(json['content'][0]['content'][1]['type']).to eq('hyperlink')
else
expect(json['content'][0]['content'][2]['type']).to eq('hyperlink')
end
expect(json['content'][1]['type']).to eq('blockLvlSdt')
expect(json['content'][2]['type']).to eq('table')
end
Expand Down
1 change: 1 addition & 0 deletions spec/docx/smoke/api_document_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
end

it 'ApiDocument | GetReviewReport method' do
skip 'https://bugzilla.onlyoffice.com/show_bug.cgi?id=71029'
skip('Cannot use OpenFile in web version') if web_builder?
docx = builder.build_and_parse('js/docx/smoke/api_document/get_review_report.js')
expect(docx.elements[3].rows[1].cells[2].elements
Expand Down
17 changes: 13 additions & 4 deletions spec/docx/smoke/api_range_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
describe 'ApiRange section tests' do
it 'ApiRange | ToJSON method' do
docx = builder.build_and_parse('js/docx/smoke/api_range/to_json.js')
expect(docx.elements[1].nonempty_runs.first.text).to eq('ONLYOFFICE')
json = JSON.parse(docx.elements[0].nonempty_runs.first.text)
expect(json['type']).to eq('document')
expect(json['content'][0]['content'][0]['content'][0]).to eq('ONLYOFFICE')
# TODO: 'check after release'
if builder.semver >= Semantic::Version.new('8.2.0')
expect(docx.elements[1].nonempty_runs.first.text).to eq('ONLYOFFICE')
expect(json['content'][0]['content'][1]['content'][0]).to eq('ONLYOFFICE')
else
expect(docx.elements[1].nonempty_runs.first.text).to eq('ONLYOFFICE ')
expect(json['content'][0]['content'][0]['content'][0]).to eq('ONLYOFFICE ')
end
end

describe 'ApiRange | GetRange method' do
let(:style) { OoxmlParser::FontStyle.new(true, true) }
let(:file_path) { 'js/docx/smoke/api_range/get_range_with_params.js' }
let(:docx) { builder.build_and_parse('js/docx/smoke/api_range/get_range.js') }

it 'Check document structure' do
Expand Down Expand Up @@ -47,7 +54,8 @@
end

it 'Check method with parameters 0, 17' do
docx = builder.build_and_parse('js/docx/smoke/api_range/get_range_with_params.js', start_pos: 0, end_pos: 17)
skip('Fix after moving to sending the script as a static file')
docx = builder.build_and_parse(file_path, start_pos: 0, end_pos: 17)
expect(docx.elements.size).to eq(1)
expect(docx.elements[0].nonempty_runs.size).to eq(2)

Expand All @@ -64,7 +72,8 @@
end

it 'Check method with parameters 10, 24' do
docx = builder.build_and_parse('js/docx/smoke/api_range/get_range_with_params.js', start_pos: 10, end_pos: 24)
skip('Fix after moving to sending the script as a static file')
docx = builder.build_and_parse(file_path, start_pos: 10, end_pos: 24)
expect(docx.elements.size).to eq(1)
expect(docx.elements[0].nonempty_runs.size).to eq(3)

Expand Down
1 change: 1 addition & 0 deletions spec/pptx/conversion/pptx_convesion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
end

it 'Conversion | Pptx to Pdf', :critical do
skip 'https://bugzilla.onlyoffice.com/show_bug.cgi?id=71025' if builder.semver >= Semantic::Version.new('8.2.0')
output_file = builder.build_file('js/conversion/pptx/pptx_to_pdf.js')
expect(builder).not_to be_file_empty(output_file)
end
Expand Down
6 changes: 5 additions & 1 deletion spec/pptx/smoke/api_master_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@
expect(pptx.slide_masters[1].common_slide_data.shape_tree.elements[1].class).to eq(OoxmlParser::GraphicFrame)
slide_elements = pptx.slides.first.common_slide_data.shape_tree.elements
expect(slide_elements.first.text_body.paragraphs.first.runs[0].text).to eq('Drawings count: 2')
expect(slide_elements.first.text_body.paragraphs.first.runs[1].text).to eq('Types: drawing, drawing')
if builder.semver >= Semantic::Version.new('8.2.0')
expect(slide_elements.first.text_body.paragraphs.first.runs[1].text).to eq('Types: image, oleObject')
else
expect(slide_elements.first.text_body.paragraphs.first.runs[1].text).to eq('Types: drawing, drawing')
end
end

it 'ApiMaster | GetAllImages method' do
Expand Down
1 change: 1 addition & 0 deletions spec/xlsx/conversion/xlsx_conversion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
end

it 'Conversion | Xlsx to Pdf' do
skip 'https://bugzilla.onlyoffice.com/show_bug.cgi?id=71025' if builder.semver >= Semantic::Version.new('8.2.0')
output_file = builder.build_file('js/conversion/xlsx/xlsx_to_pdf.js')
expect(builder).not_to be_file_empty(output_file)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
end

it 'ApiWorksheet | SetPageOrientation method' do
skip 'https://bugzilla.onlyoffice.com/show_bug.cgi?id=71025'
pdf = builder.build_and_parse('js/xlsx/smoke/api_worksheet/set_page_orientation.js')
expect(pdf.page_size).to eq('Landscape A4')
end

it 'ApiWorksheet | PageOrientation property' do
skip 'https://bugzilla.onlyoffice.com/show_bug.cgi?id=71025' if builder.semver >= Semantic::Version.new('8.2.0')
pdf = builder.build_and_parse('js/xlsx/smoke/api_worksheet/page_orientation_property.js')
expect(pdf.page_size).to eq('Landscape A4')
end
Expand Down

0 comments on commit 7c68cf8

Please sign in to comment.