Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automated_testing_kit_d7
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
automated_testing_kit_d7
Merge requests
!10
Update
PW-1111
in atk_node.spec.js
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Update
PW-1111
in atk_node.spec.js
issue/automated_testing_kit_d7-3427470:3427470-convert-atk-pw-1111-create
into
1.0.x
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Update PW-1111 in atk_node.spec.js
André Angelantoni
requested to merge
issue/automated_testing_kit_d7-3427470:3427470-convert-atk-pw-1111-create
into
1.0.x
Aug 6, 2024
Overview
0
Commits
1
Pipelines
0
Changes
1
Closes
#3427470
0
0
Merge request reports
Compare
1.0.x
1.0.x (base)
and
latest version
latest version
fab43b95
1 commit,
Aug 6, 2024
1 file
+
13
−
28
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
playwright/e2e/atk_entity/atk_node.spec.js
+
13
−
28
View file @ fab43b95
Edit in single-file editor
Open in Web IDE
Show full file
@@ -139,7 +139,7 @@ test.describe('Node tests.', () => {
//
// Create an article with an image, confirm it, update it, confirm update then delete it via the UI.
//
test
(
'
(ATK-PW-1111) Create, update, delete an article via the UI. @ATK-PW-1111 @node @smoke @alters-db
'
,
async
({
page
,
context
})
=>
{
test
(
'
(ATK-PW-1111) Create, update, delete an article via the UI. @ATK-PW-1111 @node @smoke @alters-db
'
,
async
({
page
,
context
})
=>
{
const
testId
=
'
ATK-PW-1111
'
;
const
image1Filepath
=
'
tests/data/NewspaperArticle.jpg
'
;
const
uniqueToken1
=
atkUtilities
.
createRandomString
(
6
);
@@ -148,42 +148,30 @@ test.describe('Node tests.', () => {
// Log in with the administrator account.
// You should change this to an account other than the administrator,
// which has all rights.
await
atkCommands
.
logInViaForm
(
page
,
context
,
qaUser
Account
s
.
admin
);
await
atkCommands
.
logInViaForm
(
page
,
context
,
qaUsers
.
admin
);
//
// Add an article.
//
await
page
.
goto
(
baseUrl
+
atkConfig
.
articleAddUrl
);
const
editorPage
=
new
EditorPage
(
page
);
// Fill in as many fields as you need here.
const
titleTextField
=
await
page
.
locator
(
'
input[name="title[0][value]"]
'
);
await
titleTextField
.
fill
(
`
${
testId
}
: A Title`
);
let
ckEditor
=
await
page
.
locator
(
'
[aria-label="Editor editing area: main"]
'
);
await
editorPage
.
fillTitle
(
`
${
testId
}
: A Title`
);
// Upload image.
await
page
.
setInputFiles
(
'
#edit-field-image-0-upload
'
,
image1Filepath
);
const
altField
=
page
.
locator
(
'
input[name="field_image[0][alt]"]
'
);
await
altField
.
fill
(
`
${
testId
}
:
${
uniqueToken1
}
`
);
await
editorPage
.
uploadImage
(
image1Filepath
,
`
${
testId
}
:
${
uniqueToken1
}
`
);
// Fill body.
await
ckE
ditor
.
fill
(
bodyText
);
await
page
.
getByRole
(
'
button
'
,
{
name
:
'
Save
'
}).
click
();
await
e
ditor
Page
.
fill
Text
(
bodyText
);
await
editorPage
.
save
();
//
// Confirm content appears.
//
let
divContainer
=
await
page
.
textContent
(
'
.text-content
'
);
await
expect
(
divContainer
).
toContain
(
bodyText
);
// Extract the nid placed in the body class by this hook:
// automated_testing_kit.module:automated_testing_kit_preprocess_html().
// Wait for the page to load
await
page
.
waitForLoadState
(
'
domcontentloaded
'
);
const
bodyClass
=
await
page
.
evaluate
(()
=>
document
.
body
.
className
);
const
match
=
bodyClass
.
match
(
/node-nid-
(\d
+
)
/
);
// Get the nid.
const
nid
=
parseInt
(
match
[
1
],
10
);
const
contentPage
=
new
ContentPage
(
page
);
await
contentPage
.
expectText
(
bodyText
);
const
nid
=
await
contentPage
.
getNid
();
//
// Update the node.
@@ -193,19 +181,16 @@ test.describe('Node tests.', () => {
bodyText
=
'
Ut eget ex vitae nibh dapibus vulputate ut id lacus.
'
;
await
page
.
goto
(
baseUrl
+
nodeEditUrl
);
ckEditor
=
await
page
.
locator
(
'
[aria-label="Editor editing area: main"]
'
);
await
ckEditor
.
fill
(
bodyText
);
await
editorPage
.
fillText
(
bodyText
);
// Timeouts necessary when running at full speed.
await
page
.
waitForTimeout
(
1000
);
await
page
.
getByRole
(
'
button
'
,
{
name
:
'
Save
'
}).
click
();
await
editorPage
.
save
();
await
page
.
waitForTimeout
(
1000
);
//
// Confirm content has changed.
//
divContainer
=
await
page
.
locator
(
'
.text-content
'
);
const
text
=
await
divContainer
.
textContent
();
await
expect
(
text
).
toContain
(
bodyText
);
await
contentPage
.
expectText
(
bodyText
);
//
// Delete the node.
Loading