-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(smokehouse): add basic smoke test for SEO audits #3267
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3ac7859
test(smokehouse): add smoke test for SEO audits
brendankenny 0f8582b
add SEO failure case smoke test
brendankenny 748bd2a
add meta-description to seo smoke tests
brendankenny d4ff65d
s/meta-viewport/viewport in seo config
brendankenny dd0fde5
s/bad/failures
brendankenny 6591482
short licenses
brendankenny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!doctype html> | ||
<!-- | ||
* Copyright 2017 Google Inc. All Rights Reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
--> | ||
|
||
<html> | ||
<head> | ||
<!-- no <title>SEO audit failures page</title> --> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="invalid-content=should_have_looked_it_up"> | ||
<!-- no <meta name="description" content=""> --> | ||
</head> | ||
<body> | ||
bad crawlz | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<!doctype html> | ||
<!-- | ||
* Copyright 2017 Google Inc. All Rights Reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
--> | ||
|
||
<html> | ||
<head> | ||
<title>SEO audit tester</title> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> | ||
<meta name="description" content="The premiere destination for testing your SEO audit gathering"> | ||
</head> | ||
<body> | ||
crawlz me | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* @license Copyright 2017 Google Inc. All Rights Reserved. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
*/ | ||
'use strict'; | ||
|
||
/** | ||
* Expected Lighthouse audit values for seo tests | ||
*/ | ||
module.exports = [ | ||
{ | ||
initialUrl: 'http://localhost:10200/seo/seo-tester.html', | ||
url: 'http://localhost:10200/seo/seo-tester.html', | ||
audits: { | ||
'viewport': { | ||
score: true, | ||
}, | ||
'document-title': { | ||
score: true, | ||
}, | ||
'meta-description': { | ||
score: true, | ||
} | ||
} | ||
}, | ||
{ | ||
initialUrl: 'http://localhost:10200/seo/seo-failure-cases.html', | ||
url: 'http://localhost:10200/seo/seo-failure-cases.html', | ||
audits: { | ||
'viewport': { | ||
score: false, | ||
}, | ||
'document-title': { | ||
score: false, | ||
extendedInfo: { | ||
value: { | ||
id: 'document-title' | ||
} | ||
} | ||
}, | ||
'meta-description': { | ||
score: false, | ||
} | ||
} | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
node lighthouse-cli/test/fixtures/static-server.js & | ||
|
||
sleep 0.5s | ||
|
||
config="lighthouse-core/config/seo.js" | ||
expectations="lighthouse-cli/test/smokehouse/seo/expectations.js" | ||
|
||
yarn smokehouse -- --config-path=$config --expectations-path=$expectations | ||
exit_code=$? | ||
|
||
# kill test servers | ||
kill $(jobs -p) | ||
|
||
exit "$exit_code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we're gonna need a bash script to run our bash scripts 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at shortening this to...
however it doesnt' handle the exit code correctly, so... we'll just need to make run-test.js not terrible sometime. perhaps a job for lighthouse-assert..