Skip to content
This repository has been archived by the owner on Dec 10, 2021. It is now read-only.

PLAT-118 Add scheduled_updates to makefile #148

Merged
merged 47 commits into from
Jul 19, 2016

Conversation

pvhee
Copy link
Contributor

@pvhee pvhee commented Apr 7, 2016

Fixes https://jira.comicrelief.com/browse/PLAT-118

Changes proposed in this pull request

  • Add scheduling module
  • Add selenium test
  • Add behat test to test functionality (to be done retrospectively)

Deployment instructions

  • [] Activate Scheduled Updates module
  • [] Update News Article content type publishing options to be 'Not published, Promoted to front page, Create new revision'
  • [] Disable 'Publish Date' News Article content type
  • [] 'Add Update Field' to News Article content type (/admin/structure/types/manage/article/fields) with the following parameters:
    • Update Field: 'Publishing status'
    • Default Value and Date only Updates: select 'On' and 'Hide this field for an date only update'
    • Place field on bundles: select 'News article' (should be pre selected)
    • Reference Field Options: select 'Create new reference fields to enter updates'
    • Label: 'Publishing date'
    • Update Limit: select 'Limited' and enter '1'
    • Save
  • [] Edit 'manage form display' for News article content type by moving 'Publishing Date' field just below 'Title'.

@bimsonz
Copy link
Contributor

bimsonz commented Apr 12, 2016

@pvhee whats the deal with this one?

@pvhee
Copy link
Contributor Author

pvhee commented Apr 12, 2016

@bimsonz this is just the start really, needs quite a bit more work to get to a presentable state - feel free to take over :)

@bimsonz
Copy link
Contributor

bimsonz commented Apr 13, 2016

Added to profile as mentioned in the Jira ticket @wagg-matt maybe you want to take a look at this?

@pvhee pvhee assigned wagg-matt and unassigned pvhee Apr 14, 2016
@wagg-matt
Copy link
Contributor

@pvhee what state is this one in? Happy to take it on but where does one start.....

@pvhee
Copy link
Contributor Author

pvhee commented Apr 14, 2016

@wagg-matt haven't done anything beyond adding the contrib module to the branch. What I'd suggest is to look into agov, see how they set up scheduled updates and mimick this for us. The contrib module scheduled_updates should allow us to do everything but you might need to look for some doc in the module, not sure what's available

@wagg-matt
Copy link
Contributor

@pvhee @bimsonz have got this working, hit a few stumbling blocks along the way so a few things to note are:

  • have to make a 'scheduled update' field (publish status in this example, date and time)
  • add to content type
  • content type must not be published by default
  • the 'publish date' field being used in the news article content type might need to be removed as if this is set the scheduled update will not update
  • cron must be run

Happy to investigate further into other uses. There's an example I found that has content to be published and then unpublish it at specific times - something that may be useful

@bimsonz
Copy link
Contributor

bimsonz commented Apr 27, 2016

Thanks for the update @wagg-matt !

@wagg-matt
Copy link
Contributor

@bimsonz Is the normal publish date field used for News Article content type? I would propose removing it in favour of the scheduled updates field.

@pvhee thoughts? How far do you want me to go with this PR?

@wagg-matt
Copy link
Contributor

@pvhee Have gone through this with Liv and she's asked about the following:

  • can we get rid of the normal publish date field on News Articles (I think we should)
  • can we make it optional for publish date to be displayed on the page?
  • can we add in an unpublish date for competitions etc (we can, via same process)

What do you reckon?

@pvhee
Copy link
Contributor Author

pvhee commented Apr 29, 2016

Great feedback @wagg-matt !

I think we could get rid of the publish date, that shouldn't be a problem, and replace with the scheduled update field. Could you try this in this PR if not yet done?

Regarding the option of displaying or not the publish date, we could do that as well, but let's open a new ticket first to discuss (can be in PLAT), same for the unpublish date request. I'd prefer to keep things as simple as possible, so we need to understand whether that's really going to be useful or not.

@wagg-matt
Copy link
Contributor

@bimsonz sounds good to me mate. Will remove the publish date in this PR and export it.

Will look at the rest in new tickets, first thing Tuesday, cheers man

Matthew Wagg added 2 commits July 13, 2016 12:59
…t, even though it shouldn't. Do we know the logic is correct and very likely a small tweak to the test and this can be reviewed but how long it takes me to figure out which tweak to make is anyone's guess. Will continue tomorrow, this commit will break travis in the branch but it's the latest work.
@pvhee
Copy link
Contributor Author

pvhee commented Jul 14, 2016

@wagg-matt will have a look to see if I can fix the test

@pvhee
Copy link
Contributor Author

pvhee commented Jul 14, 2016

I did some more research here and I think we need to define the steps we use to fill out a node with these publishing dates. Currently we're using And I enter todays date for "publishing_date[form][inline_entity_form][update_timestamp][0][value][date]" but when running this via selenium (adding @javascript), we get the followign error:

    Then I should see "Update Date/time"                                                                      # Drupal\DrupalExtension\Context\MinkContext::assertPageContainsText()
      The text "Update Date/time" was not found anywhere in the text of the current page. (Behat\Mink\Exception\ResponseTextException)

The problem is that this element is not found and I think we need to write a step definition to create a node with a given publishing date, rather than trying to recreate the UI via behat.

This will require a bit more dev work, and probably @Saphyel can help out writing the step definition?

Also \cc-ing @shravanmechineni as he might have an idea on how to write this test better.

@wagg-matt
Copy link
Contributor

wagg-matt commented Jul 14, 2016

@pvhee if you uncomment 'And I wait for AJAX' in every instance in that scenario and you'll see on selenium the test passes. I'll pop over and show you

@bimsonz
Copy link
Contributor

bimsonz commented Jul 18, 2016

@wagg-matt yo dude, you seen that travis error before?

@@ -0,0 +1 @@
{ }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you make sure that is deleted or added with content this file & block.block.campaign_base_main_footer ?

@wagg-matt
Copy link
Contributor

@bimsonz no mate, didn't realise it had failed was writing deployment instrustions.

@Saphyel if I get rid of that should it work? As I haven't been anywhere near the search module, unless it was updated as part of phing:export

ARGS=( $DRUPAL_TI_BEHAT_ARGS )
./vendor/bin/behat "${ARGS[@]}"
./vendor/bin/behat "${ARGS[@]}" -tags '~@javascript'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's double dash ^^

Matthew Wagg added 2 commits July 18, 2016 15:36
@bimsonz
Copy link
Contributor

bimsonz commented Jul 19, 2016

@pvhee Happy with this, just deploying this to QA3, if all looks good will merge it in

@bimsonz
Copy link
Contributor

bimsonz commented Jul 19, 2016

@pvhee going to wait to see if this passes travis with core update, should be fine but ill merge after

@pvhee
Copy link
Contributor Author

pvhee commented Jul 19, 2016

Nice work @wagg-matt - happy for this to go in as well

@bimsonz bimsonz merged commit bb44bc5 into develop Jul 19, 2016
@bimsonz bimsonz deleted the feature/PLAT-118_scheduling branch July 19, 2016 13:19
Saphyel pushed a commit that referenced this pull request Jul 25, 2016
* PLAT-118 Add scheduled_updates to makefile

* PLAT-118 Add scheduled_updates to profile

* PLAT-118 Add Scheduled updates to repo

* PLAT-118_scheduling got the export working, only thing left to do is to remove the publish by default

* PLAT-118_scheduling removing part of create feature test to finish work and rewrite test

* PLAT-118_scheduling pushing for export assistance

* PLAT-118_scheduling push for Zach to help

* PLAT-118 Fix conflict

* PLAT-118_scheduling making the article content type save as unpublished by default and updating development docs for what to do when Command cdi needs the following extension(s) enabled to run: config_devel. error message displays

* PLAT-118_scheduling first part of test

* PLAT-118_scheduling exported user role update, updated Create news articles that are linked together via a common tag test, written first iteration of scheduled updates test

* PLAT-118_scheduling updated test to dynamically use current date and time + 60 seconds

* PLAT-118_scheduling test updates waiting till scheduled update has been set

* PLAT-118 Spin function

* PLAT-118_scheduling updated test

* PLAT-118_scheduling have a working selenium test that fails without it, even though it shouldn't. Do we know the logic is correct and very likely a small tweak to the test and this can be reviewed but how long it takes me to figure out which tweak to make is anyone's guess. Will continue tomorrow, this commit will break travis in the branch but it's the latest work.

* PLAT-118 Only run tests without javascript

* PLAT-118 Tag scheduled update tests to run via selenium

* PLAT-118_scheduling removed spin step definition, added sleep step definition started scrollIntoView step definition, this needs work

* PLAT-118_scheduling selenium test now working, config exported and works, ready for code review and QA

* PLAT-118_scheduling updated what looked like a type in script.sh for behat tests as travis was failing
@pvhee pvhee mentioned this pull request Jan 5, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants